index.d.cts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435
  1. import { GeoJsonProperties, Feature, Polygon } from 'geojson';
  2. import { Coord, Units } from '@turf/helpers';
  3. /**
  4. * Creates a circular sector of a circle of given radius and center {@link Point},
  5. * between (clockwise) bearing1 and bearing2; 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 sector
  11. * @param {number} bearing2 angle, in decimal degrees, of the second radius of the sector
  12. * @param {Object} [options={}] Optional parameters
  13. * @param {string} [options.units='kilometers'] miles, kilometers, degrees, or radians
  14. * @param {number} [options.steps=64] number of steps
  15. * @param {Properties} [options.properties={}] Translate properties to Feature Polygon
  16. * @returns {Feature<Polygon>} sector polygon
  17. * @example
  18. * var center = turf.point([-75, 40]);
  19. * var radius = 5;
  20. * var bearing1 = 25;
  21. * var bearing2 = 45;
  22. *
  23. * var sector = turf.sector(center, radius, bearing1, bearing2);
  24. *
  25. * //addToMap
  26. * var addToMap = [center, sector];
  27. */
  28. declare function sector(center: Coord, radius: number, bearing1: number, bearing2: number, options?: {
  29. steps?: number;
  30. units?: Units;
  31. properties?: GeoJsonProperties;
  32. }): Feature<Polygon>;
  33. export { sector as default, sector };