Skip to main content
Version: Next

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