跳到主要内容

KVector2d.angleTo() method

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

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

Signature:

angleTo(other: KVector2d): number;

Links: angleTo(other: KVector2d): number;

Parameters

Parameter

Type

Description

other

KVector2d

要比较的向量。

The vector to compare this vector with.

Returns:

number

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

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