Skip to content

atan2 is implemented as atan(y/x) in gpu backend #647

@danbgoldman

Description

@danbgoldman

slow down egghead

What is wrong?

atan2 should return values from -pi to pi, but instead returns values from -pi/2 to pi/2 in gpu mode. It also returns undefined results for x=0.

Where does it happen?

In Chrome browser.

How do we replicate the issue?

I'm attaching a repro case - correct behavior can be seen in mode:cpu, incorrect behavior in mode:gpu.

atan2-bug.zip

How important is this (1-5)?

3 - I can work around, but also should be an easy fix.

Expected behavior (i.e. solution)

The backend GLSL implementations of atan2 use the single-argument version of atan(y_over_x), instead of the two-argument version atan(y, x).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    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