Skip to main content
Version: 7.2.0

polygonTangents

描述

¥Description

查找 (多个)多边形 的切线。

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

参数

¥Parameters

名称类型描述
pt坐标系用于计算切点的起点
polygon特性<多边形 | MultiPolygon>获取切线来自

返回

¥Returns

FeatureCollection<> 包含两个切点的要素集合

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