Inertial frame to custom local orbital frame transformation matrix
[M] = CL_fr_locOrbMat(pos, vel, frame_name) [M, omega] = CL_fr_locOrbMat(frame_name, pos, vel [, acc])
Computes the frame transformation matrix M from the inertial reference frame to a custom local orbital frame.
The inertial frame is implicitly the frame relative to which the satellite's position and velocity are defined. The local frame is built using these position and velocity vectors.
frame_name is the name of the local frame. It can be:
- 1) derived from "qsw" : "qsw", "swq", "qSW", ...
- 2) derived from "tnw" : "tnw", "nwt", "tNW", ...
- 3) an alias to a frame from 1) or 2): "lvlh" (same as "sWQ") or "rtn" (same as "qsw")
For cases 1 and 2, if 'a' (lower case!) is the name of some axis, 'A' (upper case!) is the name of the same axis in the opposite direction. The reference frame that results should be direct.
Example: "qWS" means: x-axis = q, y-axis = -w, z-axis = -s
The angular velocity vector of the local frame with respect to the inertial frame is optionally computed.
A rigourous computation requires the acceleration to be provided. But if the local frame is derived from "qsw", an approximate value can be obtained using acc = [0;0;0]. omega is then equal to: pos ^ vel / ||pos||^2. This result is exact for a keplerian motion.
Notes:
- By convention, multiplying M by coordinates relative to the inertial frame yields coordinates relative to the local frame.
- For the computation of omega to be correct, vel should be the 1st time derivative of pos, and acc should be the first time derivative of vel.
See Local frames for more details on the definition of local frames.
Satellite's position vector relative to the inertial frame [m] (3xN or 3x1)
Satellite's velocity vector relative to the inertial frame [m/s] (3xN or 3x1)
(optional) Satellite's acceleration vector relative to the inertial frame or empty. [m/s] (3xN or 3x1)
(string) Name of local frame (1x1)
Inertial to local orbital frame transformation matrix (3x3xN)
Angular velocity vector of local frame / inertial frame - components in inertial frame (3xN)
CNES - DCT/SB