Perpendicular line between two parallel lines

I have two parallel lines 1 & 2.
I want to draw a shortest perpendicular line between the end point A of line 1, to a fictive point B which is not on line 2 but on its extension, so like on the ‘plane’ of line 2.
I have no idea how to do this. Can you point me in the right direction?

One idea is to find the distance between the two parallel lines. If I have that distance then I can create a line from normal vector and length, but i would have to know the length.

I have a solution.
Create a plane parallel to line 1, by PlaneByOriginNormal, origin being a point at line 1 and the normal of the plane being the normal vector of line 1.
Then measure distance with Geometry.DistanceTo. Between the plane and line 1.

@jnoordzij Here is another way, using a plane. This would work even if the lines aren’t parallel.
PointProject.dyn (10.3 KB)

Note: Vector needs to be reversed only if Project results in an Empty List


Why not project on both vectors at the same time? One will be null and one will be good. List.clean to remove the null and your solution always works. :smiley:

1 Like