Repository: bevyengine/bevy
File: crates/bevy_math/src/rotation2d.rs (Rust)

Code before:
    /// Corresponds to a turn by 45°.
    pub const FRAC_PI_4: Self = Self {
        cos: core::f32::consts::FRAC_1_SQRT_2,
        sin: core::f32::consts::FRAC_1_SQRT_2,
    };

    /// A counterclockwise rotation of π/6 radians.
    /// Corresponds to a turn by 30°.
    pub const FRAC_PI_6: Self = Self {
        cos: 0.866_025_4,
        sin: 0.5,
    };

    /// A counterclockwise rotation of π/8 radians.
    /// Corresponds to a turn by 22.5°.
    pub const FRAC_PI_8: Self = Self {
        cos: 0.923_879_5,
        sin: 0.382_683_43,
    };

    /// Creates a [`Rot2`] from a counterclockwise angle in radians.
    /// Negative argument corresponds to a clockwise rotation.
    ///
    /// # Note
    ///
    /// Angles larger than or equal to 2π (in either direction) loop around to smaller rotations, since a full rotation returns an object into its starting orientation.
    ///
    /// # Example
    ///
    /// ```
    /// # use bevy_math::Rot2;
    /// # use approx::assert_relative_eq;
    /// # use std::f32::consts::{FRAC_PI_2, PI};
    ///
    /// let rot1 = Rot2::radians(3.0 * FRAC_PI_2);
    /// let rot2 = Rot2::radians(-FRAC_PI_2);
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(rot1, rot2);
    ///
    /// let rot3 = Rot2::radians(PI);
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(rot1 * rot1, rot3);
    ///
    /// // A rotation by 3π and 1π are the same
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(Rot2::radians(3.0 * PI), Rot2::radians(PI));
    /// ```
    #[inline]
    pub fn radians(radians: f32) -> Self {
        let (sin, cos) = ops::sin_cos(radians);
        Self::from_sin_cos(sin, cos)

Review comment (suggestion):
```suggestion
    /// Angles larger than or equal to 2π (in either direction) loop around to smaller rotations, since a full rotation returns an object to its starting orientation.
```

"returns [...] into" just feels like slightly strange phrasing

Code after:
    pub const FRAC_PI_4: Self = Self {
        cos: core::f32::consts::FRAC_1_SQRT_2,
        sin: core::f32::consts::FRAC_1_SQRT_2,
    };

    /// A counterclockwise rotation of π/6 radians.
    /// Corresponds to a counterclockwise turn by 30°.
    pub const FRAC_PI_6: Self = Self {
        cos: 0.866_025_4,
        sin: 0.5,
    };

    /// A counterclockwise rotation of π/8 radians.
    /// Corresponds to a counterclockwise turn by 22.5°.
    pub const FRAC_PI_8: Self = Self {
        cos: 0.923_879_5,
        sin: 0.382_683_43,
    };

    /// Creates a [`Rot2`] from a counterclockwise angle in radians.
    /// A negative argument corresponds to a clockwise rotation.
    ///
    /// # Note
    ///
    /// Angles larger than or equal to 2π (in either direction) loop around to smaller rotations, since a full rotation returns an object to its starting orientation.
    ///
    /// # Example
    ///
    /// ```
    /// # use bevy_math::Rot2;
    /// # use approx::assert_relative_eq;
    /// # use std::f32::consts::{FRAC_PI_2, PI};
    ///
    /// let rot1 = Rot2::radians(3.0 * FRAC_PI_2);
    /// let rot2 = Rot2::radians(-FRAC_PI_2);
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(rot1, rot2);
    ///
    /// let rot3 = Rot2::radians(PI);
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(rot1 * rot1, rot3);
    ///
    /// // A rotation by 3π and 1π are the same
    /// #[cfg(feature = "approx")]
    /// assert_relative_eq!(Rot2::radians(3.0 * PI), Rot2::radians(PI));
    /// ```
    #[inline]
    pub fn radians(radians: f32) -> Self {
        let (sin, cos) = ops::sin_cos(radians);
        Self::from_sin_cos(sin, cos)
    }