next up previous
Next: AST_END - End an AST context
Up: AST Routine Descriptions
Previous: AST_DELFITS - Delete the current FITS card in a FitsChan

   
AST_DISTANCE - Calculate the distance between two points in a Frame

Description:
This function finds the distance between two points whose Frame coordinates are given. The distance calculated is that along the geodesic curve that joins the two points.

For example, in a basic Frame, the distance calculated will be the Cartesian distance along the straight line joining the two points. For a more specialised Frame describing a sky coordinate system, however, it would be the distance along the great circle passing through two sky positions.

Invocation:
RESULT = AST_DISTANCE( THIS, POINT1, POINT2, STATUS )

Arguments:
THIS = INTEGER (Given)
Pointer to the Frame.
POINT1( * ) = DOUBLE PRECISION (Given)
An array with one element for each Frame axis (Naxes attribute) containing the coordinates of the first point.
POINT2( * ) = DOUBLE PRECISION (Given)
An array with one element for each Frame axis containing the coordinates of the second point.
STATUS = INTEGER (Given and Returned)
The global status.

Returned Value:
AST_DISTANCE = DOUBLE PRECISION
The distance between the two points.

Notes:
  • This function will return a "bad" result value (AST__BAD) if any of the input coordinates has this value.
  • A "bad" value will also be returned if this function is invoked with STATUS set to an error value, or if it should fail for any reason.



next up previous
Next: AST_END - End an AST context
Up: AST Routine Descriptions
Previous: AST_DELFITS - Delete the current FITS card in a FitsChan

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 210
R.F. Warren-Smith & D.S. Berry
30th April 2003
E-mail:ussc@star.rl.ac.uk

Copyright (C) 2003 Central Laboratory of the Research Councils