跳到主要内容

KLine2d.side() method

检查一个点相对当前这条二维直线的位置。如果在曲线左侧,则返回1。如果在曲线上,则返回0。如果在曲线右侧,则返回-1。

Check the position of the point against the current 2d line. Return 1, if the point is on the left side. Return 0, if the point is on the line. Return -1, if the point is one the right side.

Signature:

side(point: KPoint2d, tol?: number): 1 | 0 | -1;

Links: side(point: KPoint2d, tol?: number): 1 | 0 | -1;

Parameters

Parameter

Type

Description

point

KPoint2d

待检查的点。

Point to check.

tol

number

(Optional) 距离容差。如果没有给定,则采用全局容差。

distance tolerance. If it is not provided, then global tolerance is used.

Returns:

1 | 0 | -1

如果在曲线左侧,则返回1。如果在曲线上,则返回0。如果在曲线右侧,则返回-1。

Return 1, if the point is on the left side. Return 0, if the point is on the line. Return -1, if the point is one the right side.