# Usage examples

## General

tbw

## Geographical

tbw

## Astronomical

### Coordinates transformation

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

&OHgr; | longitude of the ascending node | angle between line of nodes and the zero point of longitude in the old plane.
&ohgr; | 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:

     object - strans '&ohgr;, i, &OHgr;'

or

     object - strans (&ohgr;, i, &OHgr;)

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

     object + strans '&ohgr;, i, &OHgr;'

or

     object + strans (&ohgr;, i, &OHgr;)

#### perihelion and aphelion coordinates of a comet's orbit

We are assuming the orbital elements of a comet are &OHgr;=30°, i=60° and &ohgr;=90°. We get the spherical position of perihelion and aphelion with:

    sql> SELECT set_sphere_output('DEG');
     set_sphere_output
    -------------------
     SET DEG
    (1 row)

    sql> SELECT spoint '(0,0)' + strans '90d,60d,30d' AS perihelion;
       perihelion
    --------------
     (120d , 60d)
    (1 row)

    sql> SELECT spoint '(180d,0)' + strans '90d,60d,30d' AS aphelion;
          aphelion
    ---------------
     (300d , -60d)
    (1 row)