Skip to content

PVector angleBetween returns 0 when x and y of either parameter are both 0 #1544

Description

@WolfyD

I found an existing report describing similar behavior with 3D PVectors (processing/processing#2045), but it appears the same problem affects 2D PVectors as well.

When either the start or end PVector is (0,0) the output of angleBetween() is always 0.

I'm not particularly experienced with Processing, so it's entirely possible that I'm misunderstanding something or using the API incorrectly. I tend to pick it up every few months for small projects and then promptly forget most of what I learned.

That said, I've spent some time testing this behavior and looking into the implementation, and based on what I found, I would not expect the angle to be 0 in the cases I tested.

Edit: I forgot to add, I'm using processing 4.5.2

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions