The following 19 files are available for download at GitHub:
Convert between lat/long and n-vector:
lat_long2n_E.mConverts latitude and longitude to n-vector
n_E2lat_long.mConverts n-vector to latitude and longitude
Convert between delta (i.e. local position vector) and n-vectors:
n_EA_E_and_n_EB_E2p_AB_E.mFrom two positions A and B, finds the delta position
n_EA_E_and_p_AB_E2n_EB_E.mFrom position A and delta, finds position B
Convert between n-vector and ECEF-vector (i.e. position vector from Earth center, in meters):
n_EB_E2p_EB_E.mConverts n-vector to ECEF-vector
p_EB_E2n_EB_E.mConverts ECEF-vector to n-vector
Convert between n-vector and rotation matrix:
R_EN2n_E.mFinds n-vector from
R_EL2n_E.mFinds n-vector from
Convert between Euler angles and rotation matrix:
xyz2R.mCreates a rotation matrix from three angles about new axes in the xyz order
R2xyz.mThree angles about new axes in the xyz order are found from a rotation matrix
zyx2RCreates a rotation matrix from three angles about new axes in the zyx order (e.g. yaw-pitch-roll)
R2zyx.mThree angles about new axes in the zyx order (e.g. yaw-pitch-roll) are found from a rotation matrix
Miscellaneous simple utilities:
unit.mMakes input vector unit length (i.e. norm=1)
rad.mConverts angle in degrees to radians
deg.mConverts angle in radians to degrees
R_Ee.mSelects axes of the coordinate frame E
Solutions to the ten examples:
examples.mSolutions to the ten examples.
C# (C Sharp)
C#-version of the n-vector library and the 10 examples.
Author: Jørn Inge Vestgården at FFI (responsible for translation from Matlab and adaption to C#).
C++-version of the n-vector library. (Currently, the first 8 functions in the list above are included).
Author: Magnus Baksaas at FFI (responsible for translation from Matlab and adaption to C++).
A Python-version of the entire n-vector library is available at GitHub. Python solutions to the 10 examples are also included there.
Author: Per A. Brodtkorb at FFI (responsible for translation from Matlab and adaption to Python).
A Haskell-version of the n-vector library is available at GitHub.
Author: Cedric Liegeois at Thales (responsible for translation from Matlab and adaption to Haskell).
Author: Enrico Spinielli at EUROCONTROL (responsible for translation from Matlab and adaption to R).
Java, LabVIEW etc.
If you translate the functions to another programming language, and want to make your solution available for others, we would be happy to add your files (with credits) to this site (or add a link to a site where the functions are available).