Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plane 3D logical errors #706

Open
Aronvitki opened this issue Aug 22, 2014 · 0 comments
Open

Plane 3D logical errors #706

Aronvitki opened this issue Aug 22, 2014 · 0 comments

Comments

@Aronvitki
Copy link

The distance function in the Plane3D class gives the wrong calculations. When I have a point only 10 away from the corresponding plane, it gives me this outrageously large number instead. I have the correct code for it, which is:

        if (_alignment == ALIGN_YZ_AXIS)
            return Math.abs(p.x + (d / a));
        else if (_alignment == ALIGN_XZ_AXIS)
            return Math.abs(p.y + (d / b));
        else if (_alignment == ALIGN_XY_AXIS)
            return Math.abs(p.z + (d / c));
        else
            return Math.abs(a * p.x + b * p.y + c * p.z + d) / Math.sqrt(a * a + b * b + c * c);

If you could implement this code into that distance function, it would help out others immensely.

Also, it may also help if you made the _alignment property public (get, not set).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant