# How to calculate all perpendicular unit vectors to a line through a point

A question was asked concerning the calculation of perpendicular unit vectors to a line at a point in 3-dimensional space. It was put on hold for reasons that were not entirely clear to me, but I think it is a reasonable mathematical question that gives a chance to show how to do geometrical calculations using Grassmann algebra. So I am going to ask and answer the question myself. It was a learning experience. I hope I am not violating protocol and ask your forgiveness if I am. The rephrased question is:

How to find an expression for all the unit vectors perpendicular to a known vector (a,b,c) and passing through a point (X0 ,Y0 ,Z0 ) in 3-dimensional space.

-

Although this can be done with purely symbolic variables, I am going to do this for specific numerical values. The expressions will be clearer and shorter and we can avoid considerations of checking whether specific vector components are zero. (Of course the vector has to be non-zero.)

This is done with a developmental Mathematica Application in conjunction with John Browne (who is the real mathematician here). If there are people seriously interested in exploring the application - it is rather extensive and the calculus part is mostly missing - they can contact me from my profile page.

<< GrassmannCalculus
SetPreferences["Grassmann3Space", "Vector"]
DeclareExtraScalarSymbols[θ]


Define a point and a vector through the point:

point = Origin + {2, 2, 3}.FreeBasis
vector = {1, 2, 1}.FreeBasis


Giving:

Find the vector space complement to the vector. This gives us a (unlocated) plane as a sum of bivectors.

VectorSpaceComplement[vector]
orthogonalPlane0 = % // ConvertComplements


Giving:

Let's check that this is orthogonal to the vector by taking the interior product (CircleMinus symbol) with the vector. The result should be zero.

orthogonalPlane0\[CircleMinus]vector
% // ToMetricElements


Giving:

0

In Grassmann algebra a simple element is one that can be factored into an exterior product of vectors. Let's check that this is the case.

SimpleQ[orthogonalPlane0]


True

It is simple so we obtain a factored form.

orthogonalPlane1 = ExteriorFactorize[orthogonalPlane0]


Giving:

These factors are neither unit vectors, nor are they orthogonal to each other. We will extract the first factor, normalize it, and then rotate it by an angle θ in the orthogonal plane.

firstPerpendicularVector = GrassmannNormalize[First[orthogonalPlane1]]
step1 = GrassmannPlaneRotation[θ, orthogonalPlane1][
firstPerpendicularVector] // ToMetricElements


Giving:

Then write the general perpendicular as a function of θ.

generalPerpendicular[θ_] = Collect[step1, FreeBasis, Simplify]


We check that it is a unit vector and that it is perpendicular to the initial vector.

Measure[generalPerpendicular[θ]] // Simplify
generalPerpendicular[\[Theta]]\[CircleMinus]vector // ToMetricElements
`

1

0

The following gives a snapshot of a Mathematica dynamic display which shows the position vector (in black), the line vector (in red), a segment of the perpendicular plane, and one of the orthogonal vectors (in blue) which can be rotated (within Mathematica) in the plane by the control. Also, within Mathematica we could rotate the image to visually see that the plane is orthogonal to the red vector and the blue vectors rotate within the plane. θ is the angle of rotation within the plane from the initial orthogonal vector, which was somewhat arbitrary.

-