From 1cd49957011d6c3c6b9c97bccf93002126d4e6d2 Mon Sep 17 00:00:00 2001 From: Bruce Mitchener Date: Thu, 8 Feb 2024 22:38:09 +0700 Subject: [PATCH] Fix typos. (#469) --- codegen/templates/mat.rs.tera | 2 +- codegen/templates/quat.rs.tera | 8 ++++---- src/f32/coresimd/mat4.rs | 2 +- src/f32/coresimd/quat.rs | 8 ++++---- src/f32/scalar/mat4.rs | 2 +- src/f32/scalar/quat.rs | 8 ++++---- src/f32/sse2/mat4.rs | 2 +- src/f32/sse2/quat.rs | 8 ++++---- src/f32/wasm32/mat4.rs | 2 +- src/f32/wasm32/quat.rs | 8 ++++---- src/f64/dmat4.rs | 2 +- src/f64/dquat.rs | 8 ++++---- tests/euler.rs | 2 +- tests/support/macros.rs | 4 ++-- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/codegen/templates/mat.rs.tera b/codegen/templates/mat.rs.tera index 0272f39f..efe8ba9f 100644 --- a/codegen/templates/mat.rs.tera +++ b/codegen/templates/mat.rs.tera @@ -1798,7 +1798,7 @@ impl {{ self_t }} { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/codegen/templates/quat.rs.tera b/codegen/templates/quat.rs.tera index 03d85983..78db7d9c 100644 --- a/codegen/templates/quat.rs.tera +++ b/codegen/templates/quat.rs.tera @@ -398,10 +398,10 @@ impl {{ self_t }} { const ONE_MINUS_EPS: {{ scalar_t }} = 1.0 - 2.0 * core::{{ scalar_t }}::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::{{ scalar_t }}::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -454,10 +454,10 @@ impl {{ self_t }} { const ONE_MINUS_EPSILON: {{ scalar_t }} = 1.0 - 2.0 * core::{{ scalar_t }}::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: {{ scalar_t }} = 0.0; const SIN_FRAC_PI_2: {{ scalar_t }} = 1.0; // rotation around z by PI radians diff --git a/src/f32/coresimd/mat4.rs b/src/f32/coresimd/mat4.rs index b430fcd6..1117c12c 100644 --- a/src/f32/coresimd/mat4.rs +++ b/src/f32/coresimd/mat4.rs @@ -1078,7 +1078,7 @@ impl Mat4 { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/src/f32/coresimd/quat.rs b/src/f32/coresimd/quat.rs index 0d6d1af3..0e4e703e 100644 --- a/src/f32/coresimd/quat.rs +++ b/src/f32/coresimd/quat.rs @@ -285,10 +285,10 @@ impl Quat { const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::f32::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -341,10 +341,10 @@ impl Quat { const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: f32 = 0.0; const SIN_FRAC_PI_2: f32 = 1.0; // rotation around z by PI radians diff --git a/src/f32/scalar/mat4.rs b/src/f32/scalar/mat4.rs index 9b1d1155..5affa5a5 100644 --- a/src/f32/scalar/mat4.rs +++ b/src/f32/scalar/mat4.rs @@ -999,7 +999,7 @@ impl Mat4 { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/src/f32/scalar/quat.rs b/src/f32/scalar/quat.rs index d30e4a6d..04009bc8 100644 --- a/src/f32/scalar/quat.rs +++ b/src/f32/scalar/quat.rs @@ -293,10 +293,10 @@ impl Quat { const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::f32::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -349,10 +349,10 @@ impl Quat { const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: f32 = 0.0; const SIN_FRAC_PI_2: f32 = 1.0; // rotation around z by PI radians diff --git a/src/f32/sse2/mat4.rs b/src/f32/sse2/mat4.rs index 490b9815..22d42fbe 100644 --- a/src/f32/sse2/mat4.rs +++ b/src/f32/sse2/mat4.rs @@ -1087,7 +1087,7 @@ impl Mat4 { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/src/f32/sse2/quat.rs b/src/f32/sse2/quat.rs index ce032fe3..24745776 100644 --- a/src/f32/sse2/quat.rs +++ b/src/f32/sse2/quat.rs @@ -293,10 +293,10 @@ impl Quat { const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::f32::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -349,10 +349,10 @@ impl Quat { const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: f32 = 0.0; const SIN_FRAC_PI_2: f32 = 1.0; // rotation around z by PI radians diff --git a/src/f32/wasm32/mat4.rs b/src/f32/wasm32/mat4.rs index 22b67a78..156e1de8 100644 --- a/src/f32/wasm32/mat4.rs +++ b/src/f32/wasm32/mat4.rs @@ -1078,7 +1078,7 @@ impl Mat4 { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/src/f32/wasm32/quat.rs b/src/f32/wasm32/quat.rs index 7247b279..c9dc2f81 100644 --- a/src/f32/wasm32/quat.rs +++ b/src/f32/wasm32/quat.rs @@ -285,10 +285,10 @@ impl Quat { const ONE_MINUS_EPS: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::f32::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -341,10 +341,10 @@ impl Quat { const ONE_MINUS_EPSILON: f32 = 1.0 - 2.0 * core::f32::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: f32 = 0.0; const SIN_FRAC_PI_2: f32 = 1.0; // rotation around z by PI radians diff --git a/src/f64/dmat4.rs b/src/f64/dmat4.rs index cc9147c6..e9012fec 100644 --- a/src/f64/dmat4.rs +++ b/src/f64/dmat4.rs @@ -981,7 +981,7 @@ impl DMat4 { /// `1.0`. /// /// This method assumes that `self` contains a valid affine transform. It does not perform - /// a persective divide, if `self` contains a perspective transform, or if you are unsure, + /// a perspective divide, if `self` contains a perspective transform, or if you are unsure, /// the [`Self::project_point3()`] method should be used instead. /// /// # Panics diff --git a/src/f64/dquat.rs b/src/f64/dquat.rs index eddcfa19..946721b5 100644 --- a/src/f64/dquat.rs +++ b/src/f64/dquat.rs @@ -282,10 +282,10 @@ impl DQuat { const ONE_MINUS_EPS: f64 = 1.0 - 2.0 * core::f64::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPS { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPS { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to use core::f64::consts::PI; // half a turn = 𝛕/2 = 180° Self::from_axis_angle(from.any_orthonormal_vector(), PI) } else { @@ -338,10 +338,10 @@ impl DQuat { const ONE_MINUS_EPSILON: f64 = 1.0 - 2.0 * core::f64::EPSILON; let dot = from.dot(to); if dot > ONE_MINUS_EPSILON { - // 0° singulary: from ≈ to + // 0° singularity: from ≈ to Self::IDENTITY } else if dot < -ONE_MINUS_EPSILON { - // 180° singulary: from ≈ -to + // 180° singularity: from ≈ -to const COS_FRAC_PI_2: f64 = 0.0; const SIN_FRAC_PI_2: f64 = 1.0; // rotation around z by PI radians diff --git a/tests/euler.rs b/tests/euler.rs index b2d07260..923a35d9 100644 --- a/tests/euler.rs +++ b/tests/euler.rs @@ -5,7 +5,7 @@ mod support; /// * `q`, if q.w > epsilon /// * `-q`, if q.w < -epsilon /// * `(0, 0, 0, 1)` otherwise -/// The rationale is that q and -q represent the same rotation, and any (_, _, _, 0) respresent no rotation at all. +/// The rationale is that q and -q represent the same rotation, and any (_, _, _, 0) represent no rotation at all. trait CanonicalQuat: Copy { fn canonical(self) -> Self; } diff --git a/tests/support/macros.rs b/tests/support/macros.rs index e7fadd1f..52f7a648 100644 --- a/tests/support/macros.rs +++ b/tests/support/macros.rs @@ -185,7 +185,7 @@ macro_rules! vec3_float_test_vectors { $vec3::new(0.2, 0.3, 0.4), $vec3::new(4.0, -5.0, 6.0), $vec3::new(-2.0, 0.5, -1.0), - // Pathalogical cases from : + // Pathological cases from : $vec3::new(0.00038527316, 0.00038460016, -0.99999988079), $vec3::new(-0.00019813581, -0.00008946839, -0.99999988079), ] @@ -212,7 +212,7 @@ macro_rules! vec2_float_test_vectors { $vec2::new(0.2, 0.3), $vec2::new(4.0, -5.0), $vec2::new(-2.0, 0.5), - // Pathalogical cases from : + // Pathological cases from : $vec2::new(0.00038527316, 0.00038460016), $vec2::new(-0.00019813581, -0.00008946839), ]