Skip to content

Commit

Permalink
fix segment test
Browse files Browse the repository at this point in the history
  • Loading branch information
jakmeier committed Dec 14, 2023
1 parent 43a5628 commit e59359a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bouncy_instructor/src/public/skeleton.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ pub struct Segment {
impl From<Angle3d> for Segment {
fn from(value: Angle3d) -> Self {
// polar angle of 0 means 90° in the projected 2D system
let x = value.polar.sin() * value.azimuth.sin();
let x = -value.polar.sin() * value.azimuth.sin();
let y = value.polar.cos();
let xy_len = x.hypot(y);
if xy_len.abs() <= 1e-6 {
Expand Down Expand Up @@ -91,7 +91,7 @@ mod tests {
/// Note that 0° in the exported format is the x-axis, as is common in mathematics.
/// But in the internal format, 0° is down, along the y-axis.
/// At least both systems use clock-wise angles (left-handed system) and in
/// both the y axis gros down.
/// both the y axis grows down.
#[test]
fn test_angle_to_segment() {
// (azimuth, polar), (expected_angle, expected_len)
Expand Down

0 comments on commit e59359a

Please sign in to comment.