palDafin

Sexagesimal character string to angle

Description:

Extracts an angle from a sexagesimal string with degrees, arcmin, arcsec fields using space or comma delimiters.

Invocation

void palDafin ( const char string, int ipos, double a, int j );

Arguments

string = const char (Given)
String containing deg, arcmin, arcsec fields
ipos = int (Given & Returned)
Position to start decoding " string" . First character is position 1 for compatibility with SLA. After calling this routine " iptr" will be positioned after the sexagesimal string.
a = double (Returned)
Angle in radians.
j = int (Returned)
status: 0 = OK +1 = default, A unchanged
  • 1 = bad degrees )

  • 2 = bad arcminutes ) (note 3)

  • 3 = bad arcseconds )

Notes:

The degrees field is not range checked. However, it is expected to be integral unless the other two fields are absent.

The arcminutes field is expected to be 0-59, and integral if the arcseconds field is present. If the arcseconds field is absent, the arcminutes is expected to be 0-59.9999...

The arcseconds field is expected to be 0-59.9999...

for to obtain multiply STRING A in A by

d " radians 1 = 1.0 d " turns 1/2pi = 0.1591549430918953358 h m s radians 15 = 15.0 h m s days 15/2pi = 2.3873241463784300365

Example

argument before after

STRING -57 17 44.806 12 34 56.7 unchanged IPTR 1 16 (points to 12...) A ? -1.00000D0 J ? 0