@three3d/tools
Version:
@three3d/tools 提供了 ThreeJS 常用的工具库
34 lines (19 loc) • 1.03 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@three3d/tools](./tools.md) > [getAxisRotationAngle](./tools.getaxisrotationangle.md)
## getAxisRotationAngle() function
以轴 axis 为旋转轴,获取从向量 from 到 向量 to 的旋转角度
**Signature:**
```typescript
export declare function getAxisRotationAngle(from: Vector3, to: Vector3, axis: Vector3): number;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| from | Vector3 | 起始向量 |
| to | Vector3 | 结束向量 |
| axis | Vector3 | 旋转轴; |
**Returns:**
number
## Remarks
与 [getRotationAngle()](./tools.getrotationangle.md) 区别是: - getRotationAngle 计算的是 从向量 from 到向量 to 旋转角度 - getAxisRotationAngle 计算的是 向量 from 和 向量 to 在垂直于旋转轴 axis 平面上的投影的旋转角度;即:以 axis 为旋转轴的旋转角度
以逆时钟方向为旋转正方向