Skip to main content
Answer improved, added picture.
Source Link
Nemanja
  • 386
  • 1
  • 2
  • 5

Magnetic field models, such as IGRF2000, often provide the output as a vector in a World Reference Frame, ENU (East, North, Up) or NED (North, East, Down). The components X, Y and Z from the question correspond to NED (X -> N, Y -> E, Z -> D).

If you have a position vector p$\vec{p}$ of the location where the magnetic field vector is taken in some reference frame F$F$, you can find a rotation matrix that will convert your magnetic field vector to that frame F$F$. If you have the position vector in ECEF, just follow the procedure explained below. In case the vector is in ECI, either convert it to ECEF first or you can convert the resulting magnetic field vector in ECI to ECEF (I might add this part to answer a bit later). Some hints on how to do this conversion can be found here: Transform ECI to ECEF

NED to F$F$ conversion

The goal is to find all threeenter image description here I apologize for quite bad axes inalignment job on the F framepicture, it was my first time using Blender. I'll use upper caseOn the picture there is a big coordinate system, Nrepresenting the $F$ reference frame, Elocated at the center of a sphere representing Earth. Red axis is $\hat{x}$, blue is $\hat{y}$ and D forgreen is $\hat{z}$. Small coordinate system is the NED reference frame, and lower case, nwith the red axis being North $\hat{n}$, eblue is East $\hat{e}$ and d for F framegreen is Down $\hat{d}$. The yellow line is a vector $\vec{p}$ going from the Earth center to the location of the magnetic field vector measurement.

FromTwo things should be noticed from the picture. First is that the vector $\vec{p}$ and $\hat{d}$ are coincident. Second is that $\vec{z}$, $\hat{d}$ and $\hat{n}$ are always in the same plane. For the NED reference frame, these vectors have$\hat{n}$ is always pointing straight to the following values:Earth's north, where the $\hat{z}$ is located, $\hat{d}$ straight to the Earth's center, while the $\hat{e}$ is only generally in the East direction, completing the orthogonal right handed axes triad.

  • N = [1 0 0]
  • E = [0 1 0]
  • D = [0 0 1]

The vector p itself coincides with the vector D, with D being unitary andgoal is to find all three axes of opposite directionthe NED frame in the $F$ frame. Then d

Vector $\hat{d}$ can be calculatedobtained by taking negative of unitized p:unitizing $\vec{p}$ and negating it.

  • d = - |p|$\hat{d} = - |\vec{p}|$

Crucial detail is to realize that the e vectorVector $\hat{e}$ is normal both to the just calculated d vector and the Z vector in the Earth reference frame, the vector coincident with the Earth's rotation vector,plane within which is same in both ECIlie $\hat{n}$, $\hat{d}$ and ECEF$\hat{z}$. Which means the e vector is calculated as unitized crossCross product of theseany of the two vectors: from this plane will produce $\hat{e}$. We calculated $\hat{d}$ already and we know $\hat{z} = [0 \; 0 \; 1]^T$.

  • e = |p x [0 0 1]|$\hat{e} = \hat{d} \times \hat{z}$

Finally, n$\hat{n}$ vector is normal to both d$\hat{d}$ and e$\hat{e}$, sothus:

  • n = e x d$\hat{n} = \hat{e} \times \hat{d}$

The final rotation matrix can be obtained by taking transpose of the matrix constructed with these three vectors: R = inv([n e d])

  • $R = [\hat{n} \; \hat{e} \; \hat{d}]^T$

Magnetic field models, such as IGRF2000, often provide the output as a vector in a World Reference Frame, ENU (East, North, Up) or NED (North, East, Down). The components X, Y and Z from the question correspond to NED (X -> N, Y -> E, Z -> D).

If you have a position vector p of the location where the magnetic field vector is taken in some frame F, you can find a rotation matrix that will convert your magnetic field vector to that frame F. If you have the position vector in ECEF, just follow the procedure explained below. In case the vector is in ECI, either convert it to ECEF first or you can convert the resulting magnetic field vector in ECI to ECEF (I might add this part to answer a bit later).

NED to F conversion

The goal is to find all three axes in the F frame. I'll use upper case, N, E and D for NED frame, and lower case, n, e and d for F frame.

From the NED reference frame, these vectors have the following values:

  • N = [1 0 0]
  • E = [0 1 0]
  • D = [0 0 1]

The vector p itself coincides with the vector D, with D being unitary and of opposite direction. Then d can be calculated by taking negative of unitized p:

  • d = - |p|

Crucial detail is to realize that the e vector is normal both to the just calculated d vector and the Z vector in the Earth reference frame, the vector coincident with the Earth's rotation vector, which is same in both ECI and ECEF. Which means the e vector is calculated as unitized cross product of these two vectors:

  • e = |p x [0 0 1]|

Finally, n vector is normal to both d and e, so:

  • n = e x d

The final rotation matrix can be obtained by taking transpose of the matrix constructed with these three vectors: R = inv([n e d])

Magnetic field models, such as IGRF2000, often provide the output as a vector in a World Reference Frame, ENU (East, North, Up) or NED (North, East, Down). The components X, Y and Z from the question correspond to NED (X -> N, Y -> E, Z -> D).

If you have a position vector $\vec{p}$ of the location where the magnetic field vector is taken in some reference frame $F$, you can find a rotation matrix that will convert your magnetic field vector to that frame $F$. If you have the position vector in ECEF, just follow the procedure explained below. In case the vector is in ECI, either convert it to ECEF first or you can convert the resulting magnetic field vector in ECI to ECEF. Some hints on how to do this conversion can be found here: Transform ECI to ECEF

NED to $F$ conversion

enter image description here I apologize for quite bad axes alignment job on the picture, it was my first time using Blender. On the picture there is a big coordinate system, representing the $F$ reference frame, located at the center of a sphere representing Earth. Red axis is $\hat{x}$, blue is $\hat{y}$ and green is $\hat{z}$. Small coordinate system is the NED reference frame, with the red axis being North $\hat{n}$, blue is East $\hat{e}$ and green is Down $\hat{d}$. The yellow line is a vector $\vec{p}$ going from the Earth center to the location of the magnetic field vector measurement.

Two things should be noticed from the picture. First is that the vector $\vec{p}$ and $\hat{d}$ are coincident. Second is that $\vec{z}$, $\hat{d}$ and $\hat{n}$ are always in the same plane. For the NED, $\hat{n}$ is always pointing straight to the Earth's north, where the $\hat{z}$ is located, $\hat{d}$ straight to the Earth's center, while the $\hat{e}$ is only generally in the East direction, completing the orthogonal right handed axes triad.

The goal is to find all three axes of the NED frame in the $F$ frame.

Vector $\hat{d}$ can be obtained by unitizing $\vec{p}$ and negating it.

  • $\hat{d} = - |\vec{p}|$

Vector $\hat{e}$ is normal to the plane within which lie $\hat{n}$, $\hat{d}$ and $\hat{z}$. Cross product of any of the two vectors from this plane will produce $\hat{e}$. We calculated $\hat{d}$ already and we know $\hat{z} = [0 \; 0 \; 1]^T$.

  • $\hat{e} = \hat{d} \times \hat{z}$

Finally, $\hat{n}$ vector is normal to both $\hat{d}$ and $\hat{e}$, thus:

  • $\hat{n} = \hat{e} \times \hat{d}$

The final rotation matrix can be obtained by taking transpose of the matrix constructed with these three vectors:

  • $R = [\hat{n} \; \hat{e} \; \hat{d}]^T$
Source Link
Nemanja
  • 386
  • 1
  • 2
  • 5

Magnetic field models, such as IGRF2000, often provide the output as a vector in a World Reference Frame, ENU (East, North, Up) or NED (North, East, Down). The components X, Y and Z from the question correspond to NED (X -> N, Y -> E, Z -> D).

If you have a position vector p of the location where the magnetic field vector is taken in some frame F, you can find a rotation matrix that will convert your magnetic field vector to that frame F. If you have the position vector in ECEF, just follow the procedure explained below. In case the vector is in ECI, either convert it to ECEF first or you can convert the resulting magnetic field vector in ECI to ECEF (I might add this part to answer a bit later).

NED to F conversion

The goal is to find all three axes in the F frame. I'll use upper case, N, E and D for NED frame, and lower case, n, e and d for F frame.

From the NED reference frame, these vectors have the following values:

  • N = [1 0 0]
  • E = [0 1 0]
  • D = [0 0 1]

The vector p itself coincides with the vector D, with D being unitary and of opposite direction. Then d can be calculated by taking negative of unitized p:

  • d = - |p|

Crucial detail is to realize that the e vector is normal both to the just calculated d vector and the Z vector in the Earth reference frame, the vector coincident with the Earth's rotation vector, which is same in both ECI and ECEF. Which means the e vector is calculated as unitized cross product of these two vectors:

  • e = |p x [0 0 1]|

Finally, n vector is normal to both d and e, so:

  • n = e x d

The final rotation matrix can be obtained by taking transpose of the matrix constructed with these three vectors: R = inv([n e d])