p5.Vector.fromAngle returns a 3d Vector while the Docstring says it creates a 2d Vector
Open
Nobody has claimed this yet.
Area:Math
- Dominant language
- JavaScript
- Stars
- 24k
- Forks
- 3.8k
- Avg merge
- 3d 16h
- Merged PRs (30d)
- 25
Description
Most appropriate sub-area of p5.js?
- Math
p5.js version
1.11.10
Steps to reproduce this
p5.Vector.fromAngle returns a 3d Vector while the Docstring says it creates a 2d Vector.
The Z coordinate is set to 0.
Snippet:
const v = p5.Vector.fromAngle(1, 1);
console.log(v.values[2] === 0);
console.log(v.values.length === 3);
This is confusing and might cause errors.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at the p5.Vector.fromAngle entry point and compare its documented 2D contract with the observed three-value result. Confirm the intended dimensionality, then update the documentation or behavior so they agree and verify the supplied snippet no longer exposes the mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100