polygonTangents
描述
¥Description
Finds the tangents of a (多个)多边形 from a 点.
¥Finds the tangents of a (Multi)Polygon from a Point.
参数
¥Parameters
名称 | 类型 | 描述 |
---|---|---|
pt | 坐标系 | to calculate the tangent points from |
polygon | 特性<多边形 | MultiPolygon> | 获取切线来自 |
返回
¥Returns
FeatureCollection<点> Feature Collection containing the two tangent points
¥FeatureCollection<Point> Feature Collection containing the two tangent points
示例
¥Examples
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);
安装
¥Installation
$ npm install @turf/polygon-tangents
import { polygonTangents } from "@turf/polygon-tangents";
const result = polygonTangents(...);
$ npm install @turf/turf
import * as turf from "@turf/turf";
const result = turf.polygonTangents(...);