void eraCpv(double pv[2][3], double c[2][3]) /* ** - - - - - - - ** e r a C p v ** - - - - - - - ** ** Copy a position/velocity vector. ** ** Given: ** pv double[2][3] position/velocity vector to be copied ** ** Returned: ** c double[2][3] copy ** ** Called: ** eraCp copy p-vector ** ** Copyright (C) 2013-2014, NumFOCUS Foundation. ** Derived, with permission, from the SOFA library. See notes at end of file. */ { eraCp(pv[0], c[0]); eraCp(pv[1], c[1]); return; }
void eraCr(double r[3][3], double c[3][3]) /* ** - - - - - - ** e r a C r ** - - - - - - ** ** Copy an r-matrix. ** ** Given: ** r double[3][3] r-matrix to be copied ** ** Returned: ** char[] double[3][3] copy ** ** Called: ** eraCp copy p-vector ** ** Copyright (C) 2013, NumFOCUS Foundation. ** Derived, with permission, from the SOFA library. See notes at end of file. */ { eraCp(r[0], c[0]); eraCp(r[1], c[1]); eraCp(r[2], c[2]); return; }
void eraP2pv(double p[3], double pv[2][3]) /* ** - - - - - - - - ** e r a P 2 p v ** - - - - - - - - ** ** Extend a p-vector to a pv-vector by appending a zero velocity. ** ** Given: ** p double[3] p-vector ** ** Returned: ** pv double[2][3] pv-vector ** ** Called: ** eraCp copy p-vector ** eraZp zero p-vector ** ** Copyright (C) 2013-2016, NumFOCUS Foundation. ** Derived, with permission, from the SOFA library. See notes at end of file. */ { eraCp(p, pv[0]); eraZp(pv[1]); return; }
void eraRxp(double r[3][3], double p[3], double rp[3]) /* ** - - - - - - - ** e r a R x p ** - - - - - - - ** ** Multiply a p-vector by an r-matrix. ** ** Given: ** r double[3][3] r-matrix ** p double[3] p-vector ** ** Returned: ** rp double[3] r * p ** ** Note: ** It is permissible for p and rp to be the same array. ** ** Called: ** eraCp copy p-vector ** ** Copyright (C) 2013-2016, NumFOCUS Foundation. ** Derived, with permission, from the SOFA library. See notes at end of file. */ { double w, wrp[3]; int i, j; /* Matrix r * vector p. */ for (j = 0; j < 3; j++) { w = 0.0; for (i = 0; i < 3; i++) { w += r[j][i] * p[i]; } wrp[j] = w; } /* Return the result. */ eraCp(wrp, rp); return; }