fn elliptarc(
        &mut self,
        cp: &mut Point,
        ca: Point,
        r_x: f64,
        r_y: f64,
        xar: f64,
        mut a_0: f64,
        mut a_1: f64,
        a_d: i32,
    ) -> i32
/* arc orientation        */ {
        let mut error: i32 = 0;
        if r_x.abs() < 2.5e-16f64 || r_y.abs() < 2.5e-16f64 {
            return -1;
        }
        if a_d < 0 {
            while a_1 > a_0 {
                a_1 -= 360.0f64
            }
        } else {
            while a_1 < a_0 {
                a_0 -= 360.0f64
            }
        }
        let mut d_a = a_1 - a_0;
        let mut n_c = 1;
        while d_a.abs() > 90.0f64 * n_c as f64 {
            n_c += 1
        }
        d_a /= n_c as f64;
        if d_a.abs() < 2.5e-16f64 {
            return -1;
        }
        a_0 *= core::f64::consts::PI / 180.;
        //a_1 *= core::f64::consts::PI / 180.; TODO: check
        d_a *= core::f64::consts::PI / 180.;

        let T = TMatrix::create_rotation(euclid::Angle::degrees(-xar));
        /* A parameter that controls cb-curve (off-curve) points */
        let b = 4.0f64 * (1.0f64 - (0.5f64 * d_a).cos()) / (3.0f64 * (0.5f64 * d_a).sin()); /* number of segments */
        let b_x = r_x * b;
        let b_y = r_y * b;
        let (s, c) = a_0.sin_cos();
        let p0 = T.transform_point(point2(r_x * c, r_y * s)) + ca.to_vector();
        if self.path.is_empty() {
            self.moveto(cp, p0);
        } else if !cp.equal(&p0) {
            self.lineto(cp, p0);
            /* add line seg */
        }
        let mut i = 0;
        while error == 0 && i < n_c {
            let q = a_0 + i as f64 * d_a;
            let (s, c) = q.sin_cos();
            let e0 = Point::new(c, s);
            let (s, c) = (q + d_a).sin_cos();
            let e1 = Point::new(c, s);
            /* Condition for tangent vector requirs
             *  d1 = p1 - p0 = f ( sin a, -cos a)
             *  d2 = p2 - p3 = g ( sin b, -cos b)
             * and from symmetry
             *  g^2 = f^2
             */
            /* s.p. *//* e.p. */
            let mut p0 = T.transform_point(point2(r_x * e0.x, r_y * e0.y)) + ca.to_vector();
            let p3 = T.transform_point(point2(r_x * e1.x, r_y * e1.y)) + ca.to_vector();
            let mut p1 = T.transform_point(point2(-b_x * e0.y, b_y * e0.x));
            let mut p2 = T.transform_point(point2(b_x * e1.y, -b_y * e1.x));
            p1 += p0.to_vector();
            p2 += p3.to_vector();
            error = self.curveto(&mut p0, p1, p2, p3);
            *cp = p3;
            i += 1
        }
        error
    }
/* This isn't specified as cp to somewhere. */
This isn't specified as cp to somewhere.
This isn ' t specified as cp to somewhere .
fn elliptarc(
        &mut self,
        cp: &mut Point,
        ca: Point,
        r_x: f64,
        r_y: f64,
        xar: f64,
        mut a_0: f64,
        mut a_1: f64,
        a_d: i32,
    ) -> i32
/* arc orientation        */ {
        let mut error: i32 = 0;
        if r_x.abs() < 2.5e-16f64 || r_y.abs() < 2.5e-16f64 {
            return -1;
        }
        if a_d < 0 {
            while a_1 > a_0 {
                a_1 -= 360.0f64
            }
        } else {
            while a_1 < a_0 {
                a_0 -= 360.0f64
            }
        }
        let mut d_a = a_1 - a_0;
        let mut n_c = 1;
        while d_a.abs() > 90.0f64 * n_c as f64 {
            n_c += 1
        }
        d_a /= n_c as f64;
        if d_a.abs() < 2.5e-16f64 {
            return -1;
        }
        a_0 *= core::f64::consts::PI / 180.;
        //a_1 *= core::f64::consts::PI / 180.; TODO: check
        d_a *= core::f64::consts::PI / 180.;
        let T = TMatrix::create_rotation(euclid::Angle::degrees(-xar));
        /* A parameter that controls cb-curve (off-curve) points */
        let b = 4.0f64 * (1.0f64 - (0.5f64 * d_a).cos()) / (3.0f64 * (0.5f64 * d_a).sin()); /* number of segments */
        let b_x = r_x * b;
        let b_y = r_y * b;
        let (s, c) = a_0.sin_cos();
        let p0 = T.transform_point(point2(r_x * c, r_y * s)) + ca.to_vector();
        if self.path.is_empty() {
            self.moveto(cp, p0);
        } else if !cp.equal(&p0) {
            self.lineto(cp, p0);
            /* add line seg */
        }
        let mut i = 0;
        while error == 0 && i < n_c {
            let q = a_0 + i as f64 * d_a;
            let (s, c) = q.sin_cos();
            let e0 = Point::new(c, s);
            let (s, c) = (q + d_a).sin_cos();
            let e1 = Point::new(c, s);
            /* Condition for tangent vector requirs
             *  d1 = p1 - p0 = f ( sin a, -cos a)
             *  d2 = p2 - p3 = g ( sin b, -cos b)
             * and from symmetry
             *  g^2 = f^2
             */
            /* s.p. *//* e.p. */
            let mut p0 = T.transform_point(point2(r_x * e0.x, r_y * e0.y)) + ca.to_vector();
            let p3 = T.transform_point(point2(r_x * e1.x, r_y * e1.y)) + ca.to_vector();
            let mut p1 = T.transform_point(point2(-b_x * e0.y, b_y * e0.x));
            let mut p2 = T.transform_point(point2(b_x * e1.y, -b_y * e1.x));
            p1 += p0.to_vector();
            p2 += p3.to_vector();
            error = self.curveto(&mut p0, p1, p2, p3);
            *cp = p3;
            i += 1
        }
        error
    }
fn elliptarc ( & mut self , cp : & mut Point , ca : Point , r_x : f64 , r_y : f64 , xar : f64 , mut a_0 : f64 , mut a_1 : f64 , a_d : i32 , ) -> i32 /* arc orientation        */ { let mut error : i32 = 0 ; if r_x . abs ( ) < 2.5e-16f64 || r_y . abs ( ) < 2.5e-16f64 { return - 1 ; } if a_d < 0 { while a_1 > a_0 { a_1 -= 360.0f64 } } else { while a_1 < a_0 { a_0 -= 360.0f64 } } let mut d_a = a_1 - a_0 ; let mut n_c = 1 ; while d_a . abs ( ) > 90.0f64 * n_c as f64 { n_c += 1 } d_a /= n_c as f64 ; if d_a . abs ( ) < 2.5e-16f64 { return - 1 ; } a_0 *= core :: f64 :: consts :: PI / 180. ; //a_1 *= core::f64::consts::PI / 180.; TODO: check d_a *= core :: f64 :: consts :: PI / 180. ; let T = TMatrix :: create_rotation ( euclid :: Angle :: degrees ( - xar ) ) ; /* A parameter that controls cb-curve (off-curve) points */ let b = 4.0f64 * ( 1.0f64 - ( 0.5f64 * d_a ) . cos ( ) ) / ( 3.0f64 * ( 0.5f64 * d_a ) . sin ( ) ) ; /* number of segments */ let b_x = r_x * b ; let b_y = r_y * b ; let ( s , c ) = a_0 . sin_cos ( ) ; let p0 = T . transform_point ( point2 ( r_x * c , r_y * s ) ) + ca . to_vector ( ) ; if self . path . is_empty ( ) { self . moveto ( cp , p0 ) ; } else if ! cp . equal ( & p0 ) { self . lineto ( cp , p0 ) ; /* add line seg */ } let mut i = 0 ; while error == 0 && i < n_c { let q = a_0 + i as f64 * d_a ; let ( s , c ) = q . sin_cos ( ) ; let e0 = Point :: new ( c , s ) ; let ( s , c ) = ( q + d_a ) . sin_cos ( ) ; let e1 = Point :: new ( c , s ) ; /* Condition for tangent vector requirs
             *  d1 = p1 - p0 = f ( sin a, -cos a)
             *  d2 = p2 - p3 = g ( sin b, -cos b)
             * and from symmetry
             *  g^2 = f^2
             */ /* s.p. */ /* e.p. */ let mut p0 = T . transform_point ( point2 ( r_x * e0 . x , r_y * e0 . y ) ) + ca . to_vector ( ) ; let p3 = T . transform_point ( point2 ( r_x * e1 . x , r_y * e1 . y ) ) + ca . to_vector ( ) ; let mut p1 = T . transform_point ( point2 ( - b_x * e0 . y , b_y * e0 . x ) ) ; let mut p2 = T . transform_point ( point2 ( b_x * e1 . y , - b_y * e1 . x ) ) ; p1 += p0 . to_vector ( ) ; p2 += p3 . to_vector ( ) ; error = self . curveto ( & mut p0 , p1 , p2 , p3 ) ; * cp = p3 ; i += 1 } error }
This isn't specified as cp to somewhere.
This isn ' t specified as cp to somewhere .
&mut self
cp
&mut Point
ca
Point
r_x
f64
r_y
f64
xar
f64
a_0
f64
a_1
f64
a_d
i32