diff --git a/src/point.rs b/src/point.rs index e3c4051..a2a2fe9 100644 --- a/src/point.rs +++ b/src/point.rs @@ -607,7 +607,7 @@ impl TypedPoint3D { /// /// When casting from floating point to integer coordinates, the decimals are truncated /// as one would expect from a simple cast, but this behavior does not always make sense - /// geometrically. Consider using round(), ceil or floor() before casting. + /// geometrically. Consider using `round()`, `ceil()` or `floor()` before casting. #[inline] pub fn cast(&self) -> Option> { match (NumCast::from(self.x), diff --git a/src/rect.rs b/src/rect.rs index 886c92e..7d64452 100644 --- a/src/rect.rs +++ b/src/rect.rs @@ -248,7 +248,7 @@ where T: Copy + Clone + Zero + PartialOrd + PartialEq + Add + Sub TypedRect where T: Copy + One + Add + Sub + Mul { - /// Linearly interpolate between this rectangle and another rectange. + /// Linearly interpolate between this rectangle and another rectangle. /// /// `t` is expected to be between zero and one. #[inline] diff --git a/src/rotation.rs b/src/rotation.rs index 6d30623..a50659f 100644 --- a/src/rotation.rs +++ b/src/rotation.rs @@ -391,13 +391,13 @@ where T: Copy + Clone + Self::quaternion(zero, zero, sin, cos) } - /// Creates a rotation from euler angles. + /// Creates a rotation from Euler angles. /// /// The rotations are applied in roll then pitch then yaw order. /// - /// - Roll (also calld bank) is a rotation around the x axis. - /// - Pitch (also calld bearing) is a rotation around the y axis. - /// - Yaw (also calld heading) is a rotation around the z axis. + /// - Roll (also called bank) is a rotation around the x axis. + /// - Pitch (also called bearing) is a rotation around the y axis. + /// - Yaw (also called heading) is a rotation around the z axis. pub fn euler(roll: Angle, pitch: Angle, yaw: Angle) -> Self { let half = T::one() / (T::one() + T::one()); @@ -715,7 +715,7 @@ fn pre_post() { let p = point3(1.0, 2.0, 3.0); // Check that the order of transformations is correct (corresponds to what - // we do in Transfor3D). + // we do in Transform3D). let p1 = r1.post_rotate(&r2).post_rotate(&r3).rotate_point3d(&p); let p2 = t1.post_mul(&t2).post_mul(&t3).transform_point3d(&p); @@ -796,7 +796,7 @@ fn around_axis() { assert!(r1.rotate_point3d(&point3(1.0, 2.0, 0.0)).approx_eq(&point3(2.0, 1.0, 0.0))); assert!(r2.rotate_point3d(&point3(1.0, 0.0, 0.0)).approx_eq(&point3(0.5, 0.5, -0.5.sqrt()))); - // A more arbitray test (made up with numpy): + // A more arbitrary test (made up with numpy): let r3 = Rotation3D::around_axis(vec3(0.5, 1.0, 2.0), Angle::radians(2.291288)); assert!(r3.rotate_point3d(&point3(1.0, 0.0, 0.0)).approx_eq(&point3(-0.58071821, 0.81401868, -0.01182979))); } @@ -808,7 +808,7 @@ fn from_euler() { // First test simple separate yaw pitch and roll rotations, because it is easy to come // up with the corresponding quaternion. // Since several quaternions can represent the same transformation we compare the result - // of transforming a point rather than the values of each qauetrnions. + // of transforming a point rather than the values of each quaternions. let p = point3(1.0, 2.0, 3.0); let angle = Angle::radians(FRAC_PI_2); @@ -836,7 +836,7 @@ fn from_euler() { assert!(pitch_pe.approx_eq(&pitch_pq)); assert!(yaw_pe.approx_eq(&yaw_pq)); - // Now check that the yaw pitch and roll transformations when compined are applied in + // Now check that the yaw pitch and roll transformations when combined are applied in // the proper order: roll -> pitch -> yaw. let ypr_e = Rotation3D::euler(angle, angle, angle); let ypr_q = roll_rq.post_rotate(&pitch_rq).post_rotate(&yaw_rq); diff --git a/src/transform2d.rs b/src/transform2d.rs index 5fbfccc..7ba417c 100644 --- a/src/transform2d.rs +++ b/src/transform2d.rs @@ -25,8 +25,8 @@ define_matrix! { /// /// Transforms can be parametrized over the source and destination units, to describe a /// transformation from a space to another. - /// For example, `TypedTransform2D::transform_point4d` - /// takes a `TypedPoint2D` and returns a `TypedPoint2D`. + /// For example, `TypedTransform2D::transform_point4d` + /// takes a `TypedPoint2D` and returns a `TypedPoint2D`. /// /// Transforms expose a set of convenience methods for pre- and post-transformations. /// A pre-transformation corresponds to adding an operation that is applied before diff --git a/src/transform3d.rs b/src/transform3d.rs index ebac4af..829e502 100644 --- a/src/transform3d.rs +++ b/src/transform3d.rs @@ -26,8 +26,8 @@ define_matrix! { /// /// Transforms can be parametrized over the source and destination units, to describe a /// transformation from a space to another. - /// For example, `TypedTransform3D::transform_point3d` - /// takes a `TypedPoint3D` and returns a `TypedPoint3D`. + /// For example, `TypedTransform3D::transform_point3d` + /// takes a `TypedPoint3D` and returns a `TypedPoint3D`. /// /// Transforms expose a set of convenience methods for pre- and post-transformations. /// A pre-transformation corresponds to adding an operation that is applied before @@ -166,7 +166,7 @@ where T: Copy + Clone + self.m33 == _1 && self.m44 == _1 } - /// Create a 2D transform picking the relevent terms from this transform. + /// Create a 2D transform picking the relevant terms from this transform. /// /// This method assumes that self represents a 2d transformation, callers /// should check that self.is_2d() returns true beforehand. diff --git a/src/trig.rs b/src/trig.rs index 3e342c1..26f9f00 100644 --- a/src/trig.rs +++ b/src/trig.rs @@ -28,7 +28,7 @@ macro_rules! trig { #[inline] fn tan(self) -> $ty { self.tan() } - /// A slightly faster approximation of atan2. + /// A slightly faster approximation of `atan2`. /// /// Note that it does not deal with the case where both x and y are 0. #[inline] diff --git a/src/vector.rs b/src/vector.rs index ed9ac56..456e1a6 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -424,7 +424,7 @@ define_matrix! { pub type Vector3D = TypedVector3D; impl TypedVector3D { - /// Constructor, setting all copmonents to zero. + /// Constructor, setting all components to zero. #[inline] pub fn zero() -> Self { vec3(Zero::zero(), Zero::zero(), Zero::zero()) @@ -697,7 +697,7 @@ impl TypedVector3D { /// /// When casting from floating vector to integer coordinates, the decimals are truncated /// as one would expect from a simple cast, but this behavior does not always make sense - /// geometrically. Consider using round(), ceil or floor() before casting. + /// geometrically. Consider using `round()`, `ceil()` or `floor()` before casting. #[inline] pub fn cast(&self) -> Option> { match (NumCast::from(self.x),