index.d.ts 1.0 KB

1234567891011121314151617181920212223242526
  1. import { Coord } from "@turf/helpers";
  2. /**
  3. * Takes two {@link Point|points} and finds the bearing angle between them along a Rhumb line
  4. * i.e. the angle measured in degrees start the north line (0 degrees)
  5. *
  6. * @name rhumbBearing
  7. * @param {Coord} start starting Point
  8. * @param {Coord} end ending Point
  9. * @param {Object} [options] Optional parameters
  10. * @param {boolean} [options.final=false] calculates the final bearing if true
  11. * @returns {number} bearing from north in decimal degrees, between -180 and 180 degrees (positive clockwise)
  12. * @example
  13. * var point1 = turf.point([-75.343, 39.984], {"marker-color": "#F00"});
  14. * var point2 = turf.point([-75.534, 39.123], {"marker-color": "#00F"});
  15. *
  16. * var bearing = turf.rhumbBearing(point1, point2);
  17. *
  18. * //addToMap
  19. * var addToMap = [point1, point2];
  20. * point1.properties.bearing = bearing;
  21. * point2.properties.bearing = bearing;
  22. */
  23. declare function rhumbBearing(start: Coord, end: Coord, options?: {
  24. final?: boolean;
  25. }): number;
  26. export default rhumbBearing;