Advertisement

Perpendicular line

Started by August 03, 2003 09:22 AM
4 comments, last by rotos 21 years, 6 months ago
Say I have a point and a plane. How could I determine the point on the plane that, when paired with my first point, creates a line segment perpendicular to the plane?
You need to visualize the plane as a line with a slope to make it simpler to work with. If you're talking about a totally flat plane then that would work of course.

The plane has a slope of m .

In order for a line to be perpendicular to that line or plane it needs to have a alope of -(1/m) for this condition to yield true. Testing that and dealing with the result, simple as that.

EDIT: If you are looking for a 3d solution then mine obviously will have no bearing and the post below should put you on track.

[edited by - nervo on August 3, 2003 10:54:18 AM]
Well, R2D22U2..
Advertisement
If you have the plane defined as
Ax+By+Cz +D = 0
where
[A,B,C] is the normal to the plane

the line that passes through your point having the coordinates
(x0,y0,z0)
is defined by three equations
x = x0 + At
y = y0 + Bt
z = z0 + Ct
where t is an unknown.

Hope it helps
Ciehoo
plane normal is N, and has parameter D such as D = (PointOnPlane * N)

point Q on Plane is the projection of P on the plane, so

the distance of point P to the plane is

float dist = (P * Plane.N) - Plane.D

then Q is

Q = P - Plane.N * dist

Everything is better with Metal.

I assume you have an equation of the plane and a normalized normal to the plane. If not, get them.

The known off-plane point is P
The normal to the plane is N = (A, B, C) (in 2D, C = 0)

The plane equation is A*x + B*y + C*z = D

You can make a vector V from P to some point Q on the plane by arbitrarily picking a point on the plane and subtracting P''s components from Q''s components. V = Q - P

Find the vector projection J of V onto N. Since N is normalized, J = (V.N)*N where . is dot product and * is scalar mulitplication with a vector (N).

P + J now gives you the location of the point K on the plane that is the closest point on the plane to the point P, and J is a vector projection onto N, so it''s also normal to the plane. K = P + J
Thanks for the replies, I got it now.

This topic is closed to new replies.

Advertisement