5.9. Turn the path of a line
Prev | Up | Chapter 5. Operators | Home | Next

## 5.9. Turn the path of a line #

The unary operator `!` turns the path of `sline` objects, but preserves begin and end of the spherical line. The length of returned line will be 360° minus the line length of operator's argument.

The operator `!` returns `NULL`, if the length of `sline` argument is 0, because the path of returned `sline` is undefined.

Example 5.15. Return length and check if north pole on `sline`s

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

    sql> SELECT length ( sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) ) *
            180.0 / pi() AS length;
     length
    --------
         10
    (1 row)

    sql> SELECT spoint '(0d,90d)' @
            sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) AS test;
     test
    ------
     f
    (1 row)

    sql> SELECT length ( ! sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) ) *
            180.0 / pi() AS length;
     length
    --------
        350
    (1 row)

    sql> SELECT spoint '(0d,90d)' @
            ! sline ( spoint '(0d,0d)', spoint '(0d,10d)' ) AS test;
     test
    ------
     t
    (1 row)

Prev | Up | Next
5.8. Change the direction | Home | 5.10. Transformation