# Relative orientation of satellite to a rotating plane.

We know the GPS position of a Geostationry satellite and a sensor. We also know the sensor orientation relative to the magnetic North of Earth. How do we find the orientation of Satellite relative to the current plane of sensor?

When the sensor is calibrated, its calibrated-xyz axes orients such that the xy-plane is parralell with the Earth surface, (y pointing North, x pointing East) and z pointing up ( z will go through center of Earth).

When sensor rotates, it will give out a quaternion, Q=(w, a,b,c) that descirbes its current orientatation (current-xyz) relatively to its calibrated-xyz.

To find out the relative orientation of sat on the current-xyz axes. We need to define a global coordinate, ABC.

I defined ABC such that AB is in the equatorial plane with A passes through the 0° longitude, and B passes through +90° East, C passes through Earth North Pole.

I then convert the position of satellite and sensor into this ABC-coordinate.

The next step is to transform the ABC-coordinate to the current-xyz coordinate by mean of a single rotation ideally in quaternion form.

To do this, first I need the Q1 that describes rotation from current-xyz to calibrated-xyz. Q1 is the output of sensor.

Second, I need Q2 that describes rotation from calibrated-xyz to global axes ABC.

• What is Q2 in this case ( possibly derive from its GPS coordinate and assumption that calibrated-xyz has xy tangential to sf of Earth)?

Let $(X,Y,Z)$ be the position of sensor in global coordinates. Three orthogonal unit vectors giving the orientations of local axes can be then expressed in global coordinates as: $$\hat Z={(X,Y,Z)\over\sqrt{X^2+Y^2+Z^2}},\quad \hat X={(-Y,X,0)\over\sqrt{X^2+Y^2}},\quad \hat Y={(-XZ,-YZ,X^2+Y^2)\over\sqrt{(X^2+Y^2+Z^2)(X^2+Y^2)}}.$$ The rotation matrix $R$ you need must then satisfy $$R(\hat X,\hat Y,\hat Z)=\pmatrix{1&0&0\\0&1&0\\0&0&1}, \quad\text{that is:}\quad R=(\hat X,\hat Y,\hat Z)^{-1}=(\hat X,\hat Y,\hat Z)^{T}.$$ In the above formula $(\hat X,\hat Y,\hat Z)$ is the matrix having $\hat X$, $\hat Y$, $\hat Z$ as column vectors, hence $R$ is the matrix having $\hat X$, $\hat Y$, $\hat Z$ as row vectors.
• Vector $\hat X$ is $(0,0,1)\times \hat Z$ normalized, so it is directed eastwards. As for the errors, sorry but I'm not an expert of numerical algorithms. – Aretino Jul 27 '18 at 13:39
• But on better thinking, you simply have $R^{-1}=R^T$ (the transpose), as with any orthogonal matrix. I also added that to the answer. – Aretino Jul 27 '18 at 13:49