KVector2d.isPerpendicular() method
在特定容差下判断两个向量是否垂直。 当checkFuzzyZeroVec为真时,如果两个向量中的任意一个长度在容差内接近零,结果直接为false。 当checkFuzzyZeroVec为假时,如果两个向量中的任意一个长度精确的等于零,结果直接为false。
Check if this vector is perpendicular with other vector with specified tolerance. If checkFuzzyZeroVec is true, any vector's length is nearly zero within the tolerance, false will be returned directly. If checkFuzzyZeroVec is false, only when any vector's length is exact 0, false will be returned directly.
Signature:
isPerpendicular(other: KVector2d, tolerance?: number, checkFuzzyZeroVec?: boolean): boolean;
Links: isPerpendicular(other: KVector2d, tolerance?: number, checkFuzzyZeroVec?: boolean): boolean;
Parameters
Parameter | Type | Description |
---|---|---|
other | 要比较的向量。 The vector to compare this vector with. | |
tolerance | number | (Optional) 指定的容差。默认值是1e-6。 The specified tolerance.The default value is 1e-6. |
checkFuzzyZeroVec | boolean | (Optional) 默认checkFuzzyZeroVec是真。 The default value is true. |
Returns:
boolean
如果垂直则返回true。
Return true if perpendicular, otherwise return false.