From c40574a512be8aec2acc184795a35815dd098f4e Mon Sep 17 00:00:00 2001 From: Jingwei Xu <68705456+DavidXu-JJ@users.noreply.github.com> Date: Tue, 18 Jun 2024 10:54:24 +0800 Subject: [PATCH] [doc] Fix typo & missing typedef in math/math_module.md (#8541) 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 Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- docs/cover-in-ci.lst | 1 + docs/lang/articles/math/math_module.md | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docs/cover-in-ci.lst b/docs/cover-in-ci.lst index 4d14ed5ea74c2..f6d31385f1920 100644 --- a/docs/cover-in-ci.lst +++ b/docs/cover-in-ci.lst @@ -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 diff --git a/docs/lang/articles/math/math_module.md b/docs/lang/articles/math/math_module.md index 37fdd6dea3cb8..71e64f4e15adc 100644 --- a/docs/lang/articles/math/math_module.md +++ b/docs/lang/articles/math/math_module.md @@ -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.]] @@ -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)