Skip to main content
Version: 7.3.0

polygonTangents

描述​

🌐 Description

从点寻找(多)边形的切线。

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

参数​

🌐 Parameters

名称类型描述
pt坐标用于计算切点
polygon要素<多边形 | 多多边形>用于获取切线

返回​

🌐 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(...);