next up previous
Next: astEnd - End an AST context
Up: AST Function Descriptions
Previous: astDelete - Delete an Object

   
astDistance - 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.

Synopsis:
double astDistance( AstFrame *this, const double point1[], const double point2[] )

Parameters:
this
Pointer to the Frame.
point1
An array of double, with one element for each Frame axis (Naxes attribute) containing the coordinates of the first point.
point2
An array of double, with one element for each Frame axis containing the coordinates of the second point.

Returned Value:
astDistance
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 the AST error status set, or if it should fail for any reason.



next up previous
Next: astEnd - End an AST context
Up: AST Function Descriptions
Previous: astDelete - Delete an Object

AST A Library for Handling World Coordinate Systems in Astronomy
Starlink User Note 211
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