Compute a 3d vector perpendicular to the plane described by the point and True North Heading

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

I have True North Heading in degrees, describing the way that the point will move along the surface of the earth.

I need to calculate a vector that is perpendicular to the plane created by this point along the surface of the earth.

I tried to calculate an arbitrary point along the path using the method described here and then, taking the transverse product of two vectors, however, it does not seem to be accurate enough and seems more overhead than necessary.

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

+4
source share
3 answers

I assume that you are trying to compute a vector lying in the plane of the path, and not perpendicular to it (since you already have one - the vector from the origin to your point).

First you need to calculate the vectors lying in this plane, which point to the north and east. To do this, call P your point, O source, and N = (0, 0, R) point at the top of the sphere. Then

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

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

For the same reasons

 n = cross(e, P - O) 

will point to the north and will touch the sphere.

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

 v = cos(theta) * e + sin(theta) * n 
+4
source

Here is my understanding of your problem:

  • You have a point on the surface of the Earth defined as latitude / longitude coordinates
  • The β€œtrue north” direction is the direction in which a person at this moment will travel to get to the (geographical) North Pole along the most direct route possible. That is, the "true north vector" refers to the surface of the Earth at a point of your choice and points directly to the north, parallel to the line of longitude.
  • The direction of the point movement will (initially) touch the surface of the Earth at your chosen point.
  • You have an angle in degrees from true north that indicates the heading at which this point will move.
  • This angle is the angle between the "true north vector" and the direction of the point.
  • You want to calculate a vector that touches the surface of the earth at this point, but perpendicular to the direction of the point.

If I understood everything correctly, you can do it as follows:

  • "True north vector" at lat latitude, longitude lng is determined

      [-sin (lat) * cos (lng), -sin (lat) * sin (lng), cos (lat)] 
  • A vector perpendicular to the "true north vector" that points along the line of latitude (east) is defined by the expression

      [-sin (lng), cos (lng), 0] 
  • Since these two vectors identify the plane tangent to the Earth’s surface, and the vector that determines the direction of motion of your point is also in this plane, your motion vector is a linear combination of the previous two:

      [
     - (sin (lat) * cos (lng) * cos (th) + sin (lng) * sin (th))
     - (sin (lat) * sin (lng) * cos (th) - cos (lng) * sin (th))
     cos (lat) * cos (th)
     ] 
    where th is your header angle.
  • To find a vector perpendicular to this motion vector, you can simply take the transverse product of the radius vector (i.e. the vector directed from the center of the Earth to your point,

      [cos (lat) * cos (lng), cos (lat) * sin (lng), sin (lat)] 
    with movement (this math would be dirty, it's best to let the computer handle it)
0
source

You already have 2 vectors:

N = (0,0,1) indicates directly from the origin.

P = (a, b, c) indicates from the origin to your point.

Calculate the unit vector at your point U = P / | P |

Calculate the unit vector perpendicular to U and N E = UXN

Calculate the unit vector perpendicular to U and E (this will touch the sphere) T = UXE T can point either north or south, so if Tz <0, multiply T by -1.

T now points north and is parallel to the plane tangent to the sphere at P.

Now you have enough information to build a rotation matrix (R), so you can rotate T around U. You can find how to make a matrix to rotate around any axis on wikipedia :

Using R, you can compute a vector indicating the direction of motion.

A = RT

A is the answer you are looking for.

0
source

All Articles