Skip to content

Trig functions lose precision at large angles #2199

Open
@adroitwhiz

Description

@adroitwhiz

Expected Behavior

Since trigonometric functions are periodic, they should output the same values for angles modulo 360.

Actual Behavior

At very large angles, trigonometric functions (as implemented in the underlying JavaScript VM) accumulate rounding error.

Here's a test case. Mash the spacebar enough and the problem will manifest. Note that these angles are still less than Number.MAX_SAFE_INTEGER. I've confirmed this on Linux Chrome + Firefox and Windows Firefox.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions