fn make(
        p0: Point,
        p1: Option<Point>,
        p2: Option<Point>,
        p3: Point,
        th0: f64,
        th1: f64,
        hb: HyperBezier,
    ) -> Segment {
        let r = hb.compute();
        let v = p3 - p0;
        let a = Affine::new([v.x, v.y, -v.y, v.x, p0.x, p0.y]);
        let p1 = p1.unwrap_or_else(|| {
            let p1 = HyperBezier::v_for_params(th0, hb.bias0).to_point();
            a * p1
        });
        let p2 = p2.unwrap_or_else(|| {
            let p2 = Point::new(1.0, 0.0) - HyperBezier::v_for_params(-th1, hb.bias1);
            a * p2
        });
        let k_scale = v.hypot().recip();
        Segment {
            p0,
            p1,
            p2,
            p3,
            th0,
            th1,
            k0: r.k0 * k_scale,
            k1: r.k1 * k_scale,
            hb,
            ch: r.chord,
        }
    }
/// Create a segment from a hyperbezier.
Create a segment from a hyperbezier.
Create a segment from a hyperbezier .
fn make(
        p0: Point,
        p1: Option<Point>,
        p2: Option<Point>,
        p3: Point,
        th0: f64,
        th1: f64,
        hb: HyperBezier,
    ) -> Segment {
        let r = hb.compute();
        let v = p3 - p0;
        let a = Affine::new([v.x, v.y, -v.y, v.x, p0.x, p0.y]);
        let p1 = p1.unwrap_or_else(|| {
            let p1 = HyperBezier::v_for_params(th0, hb.bias0).to_point();
            a * p1
        });
        let p2 = p2.unwrap_or_else(|| {
            let p2 = Point::new(1.0, 0.0) - HyperBezier::v_for_params(-th1, hb.bias1);
            a * p2
        });
        let k_scale = v.hypot().recip();
        Segment {
            p0,
            p1,
            p2,
            p3,
            th0,
            th1,
            k0: r.k0 * k_scale,
            k1: r.k1 * k_scale,
            hb,
            ch: r.chord,
        }
    }
fn make ( p0 : Point , p1 : Option < Point > , p2 : Option < Point > , p3 : Point , th0 : f64 , th1 : f64 , hb : HyperBezier , ) -> Segment { let r = hb . compute ( ) ; let v = p3 - p0 ; let a = Affine :: new ( [ v . x , v . y , - v . y , v . x , p0 . x , p0 . y ] ) ; let p1 = p1 . unwrap_or_else ( | | { let p1 = HyperBezier :: v_for_params ( th0 , hb . bias0 ) . to_point ( ) ; a * p1 } ) ; let p2 = p2 . unwrap_or_else ( | | { let p2 = Point :: new ( 1.0 , 0.0 ) - HyperBezier :: v_for_params ( - th1 , hb . bias1 ) ; a * p2 } ) ; let k_scale = v . hypot ( ) . recip ( ) ; Segment { p0 , p1 , p2 , p3 , th0 , th1 , k0 : r . k0 * k_scale , k1 : r . k1 * k_scale , hb , ch : r . chord , } }
Create a segment from a hyperbezier.
Create a segment from a hyperbezier .
p0
Point
p1
Option<Point>
p2
Option<Point>
p3
Point
th0
f64
th1
f64
hb
HyperBezier
p0
Point
p1
Option<Point>
p2
Option<Point>
p3
Point
th0
f64
th1
f64
hb
HyperBezier