Skip to content
This repository was archived by the owner on Jun 10, 2026. It is now read-only.
This repository was archived by the owner on Jun 10, 2026. It is now read-only.

Trig functions lose precision at large angles #2199

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

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions