8. Usage examples

8.1. General

tbw

8.2. Geographical

tbw

8.3. Astronomical

8.3.1. Coordinates transformation

A commonly used task is a coordinate transformation. With the parameters of a new coordinate system (plane) relative to an old one,

Ω longitude of the ascending node angle between line of nodes and the zero point of longitude in the old plane.
ω argument of pericenter the angle from the ascending node to the position in the new plane.
i inclination angle between the new plane and the old plane.

you can do a transformation of an object object from an old into a new coordinate system using:

 sinverse( object, strans( 'ω, i, Ω' ) )

Otherwise, for a transformation of an object object from the new into the old coordinate system, use transform:

 stransform( object, strans( 'ω, i, Ω' ) )

Example 51. Perihel and aphel coordinates of a comet orbit

We are assuming the orbital elements of a comet are Ω=30°, i=60° and ω=90°. We get the spherical position of perihel and aphel with:


mysql> SET sphere_outmode="DEG";
Query OK, 0 rows affected (0.02 sec)

mysql> SELECT sstr( stransform( spoint( '(0,0)' ), strans( '90d,60d,30d' ) ) ) AS perihel;
+--------------+
| perihel      |
+--------------+
| (120d , 60d) |
+--------------+
1 row in set (0.01 sec)

mysql> SELECT sstr( stransform( spoint( '(180d,0)' ), strans( '90d,60d,30d' ) ) ) AS aphel;
+---------------+
| aphel         |
+---------------+
| (300d , -60d) |
+---------------+
1 row in set (0.01 sec)