CL_fr_topoNMat — Local topocentric north frame
[M] = CL_fr_topoNMat(lon,lat)
Warning : The origin of a topocentric North frame is not the center of the planet : it is the given point of longitude and latitude : the complete frame transfer is done through a rotation (of matrix M) and a translation.
x: a unit vector towards norh
y: a unit vector (local paralel tangent) towards west
z: a unit vector in direction of the local vertical
To convert a vector to or from topocentric north frame : see examples or use CL_fr_topoN2ter and CL_fr_ter2topoN
For big hypermatrixes, it is faster to use the functions CL_fr_topoN2ter and CL_fr_ter2topoN
[LON;LAT;H] topocentric frame origin in elliptical (geodetic) coordinates [rad;rad;m] (3xN)
frame transfer matrix from a planet centered frame to the topocentric North frame of given origin (3x3xN)
//Conversion from pos_ter to pos_topoN : you need to use the (hyper)matrix M orig = [CL_deg2rad(40) ; CL_deg2rad(10) ; 0]; pos_orig = CL_co_ell2car(orig); pos_ter = [ 1000.e3 ; 6578.e3 ; 2000.e3 ]; pos_ter_orig = pos_ter - pos_orig; M = CL_fr_topoNMat(orig); pos_topoN = M * pos_ter_orig; pos_topoN_2 = CL_fr_ter2topoN(orig,pos_ter); //Conversion from pos_topoN to pos_ter : you need to use the (hyper)matrix M' orig = [CL_deg2rad(40) ; CL_deg2rad(10) ; 0]; pos_orig = CL_co_ell2car(orig); pos_topoN = [ 0.e3 ; 0.e3 ; 1000.e3 ]; // 1000 km above 40° / 10° M = CL_fr_topoNMat(orig); pos_ter = M' * pos_topoN + pos_orig; pos_ter_2 = CL_fr_topoN2ter(orig,pos_topoN);