index.d.ts 906 B

12345678910111213141516171819202122
  1. import { Polygon, MultiPolygon, Feature, FeatureCollection, Point } from 'geojson';
  2. import { Coord } from '@turf/helpers';
  3. /**
  4. * Finds the tangents of a {@link Polygon|(Multi)Polygon} from a {@link Point}.
  5. *
  6. * @function
  7. * @param {Coord} pt to calculate the tangent points from
  8. * @param {Feature<Polygon|MultiPolygon>} polygon to get tangents from
  9. * @returns {FeatureCollection<Point>} Feature Collection containing the two tangent points
  10. * @example
  11. * var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
  12. * var point = turf.point([61, 5]);
  13. *
  14. * var tangents = turf.polygonTangents(point, polygon)
  15. *
  16. * //addToMap
  17. * var addToMap = [tangents, point, polygon];
  18. */
  19. declare function polygonTangents<T extends Polygon | MultiPolygon>(pt: Coord, polygon: Feature<T> | T): FeatureCollection<Point>;
  20. export { polygonTangents as default, polygonTangents };