Skip to main content
Version: 7.2.0

booleanParallel

描述

¥Description

如果 line1 的每个线段都与 line2 的对应线段平行,则 Boolean-Parallel 返回 True。

¥Boolean-Parallel returns True if each segment of line1 is parallel to the correspondent segment of line2

参数

¥Parameters

名称类型描述
line1几何图形 | 特性<LineString>GeoJSON 要素或几何体
line2几何图形 | 特性<LineString>GeoJSON 要素或几何体

返回

¥Returns

boolean 如果线平行,则为 true/false

¥boolean true/false if the lines are parallel

示例

¥Examples

var line1 = turf.lineString([
[0, 0],
[0, 1],
]);
var line2 = turf.lineString([
[1, 0],
[1, 1],
]);

turf.booleanParallel(line1, line2);
//=true

安装

¥Installation

$ npm install @turf/boolean-parallel

import { booleanParallel } from "@turf/boolean-parallel";
const result = booleanParallel(...);
$ npm install @turf/turf

import * as turf from "@turf/turf";
const result = turf.booleanParallel(...);