diff --git a/src/utilities.jl b/src/utilities.jl index 6e5ee144..855e561a 100644 --- a/src/utilities.jl +++ b/src/utilities.jl @@ -69,7 +69,7 @@ end #Double quadratic Bezier curve function Bezier(t::T, p0::T, p2::T, q0::T, q1::T, q2::T) where T<:Real - B(t,a,b,c)=a*(1.0-t)^2.0+2.0b*(1.0-t)*t+c*t^2.0 + B(t,a,b,c)=a*(1.0-t)^2 + 2.0b*(1.0-t)*t + c*t^2 if t <= 0.5 return B(2.0t, p0, q0, q1) else #t > 0.5 @@ -79,7 +79,7 @@ end #Inverse double quadratic Bezier curve function invBezier(t::T, p0::T, p2::T, q0::T, q1::T, q2::T) where T<:Real - invB(t,a,b,c)=(a-b+sqrt(b^2.0-a*c+(a-2.0b+c)*t))/(a-2.0b+c) + invB(t,a,b,c)=(a-b+sqrt(b^2-a*c+(a-2.0b+c)*t))/(a-2.0b+c) if t < q1 return 0.5*invB(t,p0,q0,q1) else #t >= q1