Created
February 28, 2011 12:09
-
-
Save att88/847239 to your computer and use it in GitHub Desktop.
Distance from Point (x, y, z) to Plane (ax + by + cz + d = 0)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
double Point::distanceTo(Plane p) { | |
return abs( p.a * x + p.b * y + p.c * z + p.d) / | |
sqrt(p.a * p.a + p.b * p.b + p.c * p.c); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment