跳到主要内容

KVector3d.angleTo() method

以特定方向来计算两向量的夹角,以弧度计。

Calculate the angle to other vector, with vecRef as reference.

Signature:

angleTo(other: KVector3d, vecRef: KVector3d): number;

Links: angleTo(other: KVector3d, vecRef: KVector3d): number;

Parameters

Parameter

Type

Description

other

KVector3d

要比较的向量。

The vector to compare this vector with.

vecRef

KVector3d

该向量用来决定角度计算的时针方向。

the reference vec to determine the counter clockwise direction.

Returns:

number

两向量的夹角,范围为[0, 2PI]。

The angle between the two vectors, the range is [0, 2PI).