Skip to content

KBE3D / KBCore / turf / polygonTangents

函数: polygonTangents()

polygonTangents<T>(pt: Coord, polygon: T | Feature<T, GeoJsonProperties>): FeatureCollection<Point>

Function

Finds the tangents of a (Multi)Polygon from a Point.

类型参数

T

T extends Polygon | MultiPolygon

参数

pt

Coord

to calculate the tangent points from

polygon

to get tangents from

T | Feature<T, GeoJsonProperties>

返回

FeatureCollection<Point>

Feature Collection containing the two tangent points

示例

ts
var polygon = turf.polygon([[[11, 0], [22, 4], [31, 0], [31, 11], [21, 15], [11, 11], [11, 0]]]);
var point = turf.point([61, 5]);

var tangents = turf.polygonTangents(point, polygon)

//addToMap
var addToMap = [tangents, point, polygon];

KBE3D @3.0.0 Copyright © 2024-present KBE3D