Skip to content

p5.Vector.fromAngle returns a 3d Vector while the Docstring says it creates a 2d Vector #8048

@jan-23

Description

@jan-23

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Ready for Work

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions