Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Doc] Fix a typo in math/math_module.md #8541

Merged
merged 5 commits into from
Jun 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/cover-in-ci.lst
Original file line number Diff line number Diff line change
Expand Up @@ -36,3 +36,4 @@ docs/rfcs/yyyymmdd-rfc-template.md
docs/lang/articles/math/linear_solver.md
docs/lang/articles/math/sparse_matrix.md
docs/lang/articles/get-started/cloth_simulation.md
docs/lang/articles/math/math_module.md
4 changes: 3 additions & 1 deletion docs/lang/articles/math/math_module.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ You can use these types to instantiate vectors/matrices or annotate data types f

```python
mat2 = ti.math.mat2
vec3 = ti.math.mat3
vec3 = ti.math.vec3
vec4 = ti.math.vec4

m = mat2(1) # [[1., 1.], [1., 1.]]
Expand Down Expand Up @@ -113,6 +113,8 @@ u = v.rraa # vec4(1, 1, 2, 2)
- `ti.Vector` is a function that accepts a 1D array and returns a matrix instance that has only one column. For example, `ti.Vector([1, 2, 3, 4, 5])`.
- `ti.types.vector` is a function that accepts an integer and a primitive type and returns a vector type. For example: `vec5f = ti.types.vector(5, float)`. `vec5f` can then be used to instantiate 5D vectors or annotate data types of function arguments and struct members:
```python
vec5f = ti.types.vector(5, float)
feisuzhu marked this conversation as resolved.
Show resolved Hide resolved

@ti.kernel
def test(v: vec5f):
print(v.xyz)
Expand Down
Loading