polygonTangents
描述
🌐 Description
🌐 Finds the tangents of a (Multi)Polygon from a Point.
参数
🌐 Parameters
| 名称 | 类型 | 描述 |
|---|---|---|
| pt | Coord | 计算切点从 |
| polygon | Feature<Polygon | MultiPolygon> | 从……获取切线 |
返回
🌐 Returns
FeatureCollection<Point> 包含两个切点的要素集合
示例
🌐 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(...);