Skip to content

Commit

Permalink
Clippy: Simplify Duplicated code block.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfrances107 committed Oct 13, 2021
1 parent f43af7a commit 7680c90
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions geo/src/algorithm/polygon_distance_fast_path.rs
Expand Up @@ -369,29 +369,25 @@ where
let perpunit = unitpvector(p, punit);
let mut obtuse = false;
let left = leftturn(p, perpunit, Point(pnext));
if left == 0 {
obtuse = true;
}
if clockwise {
if left == 0 {
obtuse = true;
}
if left == -1 {
angle = T::PI() / (T::one() + T::one());
} else if !obtuse {
angle = (-sine).asin();
} else {
angle = T::PI() - (-sine).asin();
}
} else if left == -1 {
angle = T::PI() / (T::one() + T::one());
} else if !obtuse {
angle = sine.asin();
} else {
if left == 0 {
obtuse = true;
}
if left == -1 {
angle = T::PI() / (T::one() + T::one());
} else if !obtuse {
angle = sine.asin();
} else {
angle = T::PI() - sine.asin();
}
angle = T::PI() - sine.asin();
}

angle
}

Expand Down

0 comments on commit 7680c90

Please sign in to comment.