Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
Uriopass committed Aug 13, 2023
1 parent 15baefe commit c714ad8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions geom/src/angle.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ use serde::{Deserialize, Serialize};
use std::f32::consts::{PI, TAU};
use std::ops::{Add, AddAssign, Mul, Sub, SubAssign};

#[derive(Serialize, Deserialize, Copy, Clone, PartialOrd, PartialEq, Default)]
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialOrd, PartialEq, Default)]
#[serde(from = "f32", into = "f32")]
#[repr(transparent)]
pub struct Degrees(pub f32);

#[derive(Serialize, Deserialize, Copy, Clone, PartialOrd, PartialEq, Default)]
#[derive(Serialize, Deserialize, Debug, Copy, Clone, PartialOrd, PartialEq, Default)]
#[serde(from = "f32", into = "f32")]
#[repr(transparent)]
pub struct Radians(pub f32);
Expand All @@ -17,6 +17,7 @@ impl Radians {
pub const HALFPI: Self = Radians(std::f32::consts::FRAC_PI_2);
pub const PI: Self = Radians(PI);
pub const TAU: Self = Radians(TAU);
pub const ZERO: Self = Radians(0.0);

pub fn vec2(self) -> Vec2 {
Vec2 {
Expand Down
2 changes: 1 addition & 1 deletion geom/src/v2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1161,6 +1161,6 @@ mod tests {

#[test]
fn test_angle_cossin() {
assert_eq!(vec2(1.0, 0.0).angle_cossin(), 0.0);
assert_eq!(vec2(1.0, 0.0).angle_cossin(), Radians::ZERO);
}
}

0 comments on commit c714ad8

Please sign in to comment.