geo.bearing( p1 as cts.point, p2 as cts.point, [options as String[]] ) as Number
Returns the true bearing in radians of the path from the first point to the second. An error is raised if the two points are the same.
The value of the precision
option takes precedence over
that implied by the governing coordinate system name, including the
value of the coordinate-system
option. For example, if the
governing coordinate system is "wgs84/double" and the precision
option is "float", then the operation uses single precision.
Tolerance reflects how accurate you believe the data is. Computing a bearing between two points that are effectively equal within the limits of data accuracy is likely to produce useless results: The tolerance parameter can be used to force an error in this situation. Effective tolerance may be limited by the limits of precision.
const sf = cts.point(37, -122); const ny = cts.point(40, -73); geo.bearing(sf, ny); => 1.2212785952625
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.