This commit is contained in:
boybook
2025-12-01 20:59:16 +08:00
parent 12738a142c
commit 760c2dd9ad
5535 changed files with 21070 additions and 2021 deletions

View File

@@ -1,5 +1,5 @@
---
front:
front:
hard: 入门
time: 分钟
---
@@ -281,7 +281,7 @@ c = Vector3.Dot(a, b) # 1 * 0 + 2 * 3 + 3 * 1 = 9
| 数据类型 | 说明 |
| :------- | :------------- |
| float | 两个向量的积 |
| Vector3 | 两个向量的积 |
- 示例
@@ -296,6 +296,72 @@ c = Vector3.Cross(a, b)
## 成员方法
### x
- 描述
返回该向量的x坐标值。
- 返回值
| 数据类型 | 说明 |
| :------- | :-------------- |
| float | 该向量x的坐标值 |
- 示例
```python
from common.utils.mcmath import Vector3
a = Vector3(3.0, 4.0, 0.0)
print a.x # 打印 3.0
```
### y
- 描述
返回该向量的y坐标值。
- 返回值
| 数据类型 | 说明 |
| :------- | :-------------- |
| float | 该向量y的坐标值 |
- 示例
```python
from common.utils.mcmath import Vector3
a = Vector3(3.0, 4.0, 0.0)
print a.y # 打印 4.0
```
### z
- 描述
返回该向量的z坐标值。
- 返回值
| 数据类型 | 说明 |
| :------- | :-------------- |
| float | 该向量z的坐标值 |
- 示例
```python
from common.utils.mcmath import Vector3
a = Vector3(3.0, 4.0, 0.0)
print a.z # 打印 0.0
```
### Length
- 描述
@@ -551,4 +617,4 @@ print a / 2 # 打印结果(1.5, 2, 0)
- 描述
判断两个向量是否不等当各分量均相等时返回False
判断两个向量是否不等当各分量均相等时返回False