Skip to content

Commit

Permalink
[doc] Fix typo & missing typedef in math/math_module.md (#8541)
Browse files Browse the repository at this point in the history
Issue: The typo in the documentation is located at
https://docs.taichi-lang.org/docs/math_module#small-vector-and-matrix-types

![image](https://github.com/taichi-dev/taichi/assets/68705456/d364aa74-3bc3-493d-9ddb-d6f23090f093)


### Brief Summary

copilot:summary

### Walkthrough

copilot:walkthrough

---------

Co-authored-by: Proton <feisuzhu@163.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
  • Loading branch information
3 people committed Jun 18, 2024
1 parent 0b48e59 commit c40574a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
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)

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

0 comments on commit c40574a

Please sign in to comment.