Calculate 3d Vector perpendicular to plane described by a Point and True North Heading

3dgeolocationgeometrymathvector

I have a Point on the surface of the earth which I am converting to a Vector from Earth Center.

I have a True North Heading in degrees describing the path the point will travel on the surface of the earth.

I need to calculate a Vector which is perpendicular to the plane created by the path of this point along the earths surface.

I have tried calculating an arbitrary point along the path using the method described here
and then taking the cross product of the two vectors however it does not seem to be quite accurate enough and seems like more overhead than is necessary.

This is related to my other post ray-polygon-intersection-point-on-the-surface-of-a-sphere.

Best Answer

I'm assuming you're trying to compute a vector lying in the plane of the path, not perpendicular to it (since you've already got one - namely the vector from the origin to your point).

You first need to compute vectors lying in that plane that point due north and due east. To do this, let's call P your point, O the origin, and N = (0, 0, R) is the point at the top of your sphere. Then

e = cross(N - P, P - O)

is a vector that points due east, and is tangent to the sphere because it's perpendicular to P - O, a radius of the sphere.

For similar reasons

n = cross(e, P - O)

will point due north, and will be tangent to the sphere.

Now normalize n and e, and you've got an orthonormal basis for the tangent space at your point. To find a vector in a direction theta (say, counterclockwise from the positive east axis, to simplify the math), just take a little of e and a little of n:

v = cos(theta) * e + sin(theta) * n
Related Topic