Reputation: 466
suppose i have a plane equation ax+by+cz=d, how can I go about finding the shortest distance from the plane to the origin?
I am going in reverse of this post. In this post, they start out with a point P0 and the normal. In my case, I only have the plane equation Distance from origin to plane (shortest)
Here is what I have so far.
#calculate the distance from plane to origin
dist=math.sqrt(new_a**2+new_b**2+new_c**2)
x_dist=(a*d)/dist
y_dist=(b*d)/dist
z_dist=(c*d)/dist
Upvotes: 0
Views: 1085
Reputation: 2811
The normal of your plane is [a,b,c]
. Multiply it by d
and get the length of the result. This should give you what you need.
Upvotes: 1