This commit is contained in:
Hanno Braun 2023-02-16 12:55:09 +01:00
parent a6683aa19f
commit dc2bfaa0bd

View File

@ -34,10 +34,11 @@ impl Arc {
let radius = distance_between_endpoints let radius = distance_between_endpoints
/ (2. * (angle_rad.abs().into_f64() / 2.).sin()); / (2. * (angle_rad.abs().into_f64() / 2.).sin());
let clockwise_turn = angle_rad <= Scalar::ZERO;
let more_than_half_turn = angle_rad.abs() > Scalar::PI; let more_than_half_turn = angle_rad.abs() > Scalar::PI;
let center = { let center = {
let f = match (angle_rad <= Scalar::ZERO, more_than_half_turn) { let f = match (clockwise_turn, more_than_half_turn) {
(false, false) => Scalar::ONE, (false, false) => Scalar::ONE,
(false, true) => -Scalar::ONE, (false, true) => -Scalar::ONE,
(true, false) => -Scalar::ONE, (true, false) => -Scalar::ONE,