$LastChangedDate: 01-Mar-2010 $

# Conventions used in CelestLab

Conventions used in CelestLab

## Naming conventions

All CelestLab exported names begin with the prefix "CL_" (for functions) or "%CL_" (for predefined data).

Most function names have an additional prefix (2 or 3 letters) that indicates the purpose of the function:

- CL_co : conversion of coordinates
- CL_dat : conversion of dates and time
- CL_fr : conversion of reference frames
- CL_oe : conversion of type of orbital elements
- CL_gm : orbital geometry
- CL_3b : three body problem (Lagrange points)
- CL_mod : models (precession-nutation models, sidereal time, atmospheric models, planet positions, ...)
- CL_kp : keplerian computations
- CL_op : orbit properties (sun-synchronous orbits, frozen orbits, repeating ground tracks, ...)
- CL_cw : Clohessy Whiltshire formalism (relative motion)
- CL_dsp : dispersions analysis (covariance propagation, monte carlo, ...)
- CL_ex : orbit propagation (analytical models for orbit propagation)
- CL_man : orbital maneuvers (Hohmann, Lambert transfer, ...)
- CL_ : utility functions

## Vectors

In CelestLab most functions are vectorized. Arguments of functions are generally vectors of size :

- (1,N) for a set of scalars
- (3,N) for a set of 3D-vectors (for example: position, velocity, ...)
- (6,N) for a set of orbital elements (See orbital elements)
- (3,3,N) for a set of frame transformation matrices

## Frame transformation matrices

The frame transformation matrix P(i->f) is defined as the matrix transforming vector coordinates relative to an initial frame Ri to coordinates relative to a final frame Rf :

The rotation matrix that transforms the basis vectors of Ri into the basis vectors of Rf is then P(i->f)' (P transpose).

For example, the transformation matrix for a rotation of angle θ around the X axis is :

## Quaternions

CelestLab contains operators for the management of quaternions :

- Creation: see CL_rot_defQuat
- Operations with scalars : q*alpha (same as alpha*q), q/alpha, alpha/q, -q
- Operations with row vectors : q.*alpha (same as alpha.*q), q./alpha, alpha./q
- Logical operators on quaternions : q1==q2
- Operations with 2 quaternions : q1*q2 , q1/q2, q1+q2, q1-q2
- Other operations on quaternions :

  - size(q)

  - norm(q)

  - inv(q)

  - conjugate: conj(q) = ~q = q'

  - extraction of real and imaginary part: real(q) = q.r, imag(q) = q.i

  - concatenation: [q1,q2,...,qn]

  - extraction: q2 = q1([i,j,k,...])

  - insertion: q2([i,j,k,...]) = q1

NB: Quaternions as defined in CelestLab are consistent with rotation matrices.

## Hypermatrices

Scilab's hypermatrix type (mlist 'hm') is partly overloaded in CelestLab. Hypermatrices should be of dimension 3.

A hypermatrix is considered as an array of matrices: A = [A1; A2...; An], where Ak = A(:,:,k).

The overloaded operations are :

- Multiplication of a hypermatrix by a hypermatrix: C = A * B, which is defined by: C = [A1*B1; A2*B2...; An*Bn].
- Multiplication of a hypermatrix by a matrix: C = A * B, which is defined by: C = [A1*B; A2*B...; An*B].
- Transposition of a hypermatrix: A', which is defined by: C = [A1'; A2'...; An'].
- Other operations: B = acos(A), defined by: B(:) = acos(A(:)).