docs: update math API docs
This commit is contained in:
35
docs/api/math/quaternion/from-axis-angle.md
Normal file
35
docs/api/math/quaternion/from-axis-angle.md
Normal file
@@ -0,0 +1,35 @@
|
||||
# Quaternion::FromAxisAngle
|
||||
|
||||
```cpp
|
||||
static Quaternion FromAxisAngle(const Vector3& axis, float radians);
|
||||
```
|
||||
|
||||
从轴角表示创建四元数。使用半角公式进行转换。
|
||||
|
||||
**参数:**
|
||||
- `axis` - 旋转轴(会被归一化)
|
||||
- `radians` - 旋转角度(弧度)
|
||||
|
||||
**返回:** 表示该旋转的四元数
|
||||
|
||||
**线程安全:** ✅
|
||||
|
||||
**复杂度:** O(1)
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Math/Quaternion.h>
|
||||
#include <XCEngine/Math/Vector3.h>
|
||||
#include <XCEngine/Math/Math.h>
|
||||
|
||||
using namespace XCEngine::Math;
|
||||
|
||||
Quaternion q = Quaternion::FromAxisAngle(Vector3::Up(), Math::Radians(90.0f));
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Quaternion](quaternion.md) - 返回类总览
|
||||
- [FromEulerAngles](from-euler-angles.md) - 从欧拉角创建
|
||||
- [LookRotation](look-rotation.md) - 创建看向目标的旋转
|
||||
Reference in New Issue
Block a user