index.d.ts 1010 B

12345678910111213141516171819202122
  1. import { Coord } from "@turf/helpers";
  2. /**
  3. * Finds the angle formed by two adjacent segments defined by 3 points. The result will be the (positive clockwise)
  4. * angle with origin on the `startPoint-midPoint` segment, or its explementary angle if required.
  5. *
  6. * @name angle
  7. * @param {Coord} startPoint Start Point Coordinates
  8. * @param {Coord} midPoint Mid Point Coordinates
  9. * @param {Coord} endPoint End Point Coordinates
  10. * @param {Object} [options={}] Optional parameters
  11. * @param {boolean} [options.explementary=false] Returns the explementary angle instead (360 - angle)
  12. * @param {boolean} [options.mercator=false] if calculations should be performed over Mercator or WGS84 projection
  13. * @returns {number} Angle between the provided points, or its explementary.
  14. * @example
  15. * turf.angle([5, 5], [5, 6], [3, 4]);
  16. * //=45
  17. */
  18. declare function angle(startPoint: Coord, midPoint: Coord, endPoint: Coord, options?: {
  19. explementary?: boolean;
  20. mercator?: boolean;
  21. }): number;
  22. export default angle;