index.d.ts 1.2 KB

123456789101112131415161718192021222324252627282930313233
  1. import { Feature, LineString } from 'geojson';
  2. import { Coord, Units } from '@turf/helpers';
  3. /**
  4. * Creates a circular arc, of a circle of the given radius and center point, between bearing1 and bearing2;
  5. * 0 bearing is North of center point, positive clockwise.
  6. *
  7. * @function
  8. * @param {Coord} center center point
  9. * @param {number} radius radius of the circle
  10. * @param {number} bearing1 angle, in decimal degrees, of the first radius of the arc
  11. * @param {number} bearing2 angle, in decimal degrees, of the second radius of the arc
  12. * @param {Object} [options={}] Optional parameters
  13. * @param {number} [options.steps=64] number of steps (straight segments) that will constitute the arc
  14. * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians
  15. * @returns {Feature<LineString>} line arc
  16. * @example
  17. * var center = turf.point([-75, 40]);
  18. * var radius = 5;
  19. * var bearing1 = 25;
  20. * var bearing2 = 47;
  21. *
  22. * var arc = turf.lineArc(center, radius, bearing1, bearing2);
  23. *
  24. * //addToMap
  25. * var addToMap = [center, arc]
  26. */
  27. declare function lineArc(center: Coord, radius: number, bearing1: number, bearing2: number, options?: {
  28. steps?: number;
  29. units?: Units;
  30. }): Feature<LineString>;
  31. export { lineArc as default, lineArc };