get-medial-point-coeffs-bez2
function getMedialPointCoeffsBez2(p: number[], v: number[], ps: number[][]): { A: number[]; B: number[]; C: number[]; D: number[]; H: number[]; }
Defined in get-medial-points/double/get-medial-point-coeffs-bez2.ts:25
Returns the polynomial coefficients for the ray parameter t and the
curve parameter s that encode the medial condition for q(t) = p + t⋅v
and a quadratic bezier curve ps.
The returned coefficients describe the equations whose common solutions satisfy:
q(t)is equidistant frompand the nearest point onps- that common distance is locally minimal among such candidates
More specifically, this function returns:
AandB: the coefficients ofE2(s,t) = A(s)⋅t + B(s)CandD: the coefficients ofE1(s,t) = C(s)⋅t + D(s)H: the eliminated polynomialA(s)⋅D(s) - B(s)⋅C(s)whose roots are candidatesvalues for medial points
Parameters:
| Name | Type | Description |
|---|---|---|
p | number[] | base point |
v | number[] | ray direction from p |
ps | number[][] | quadratic bezier control points, i.e. an order 2 bezier curve given as an array of control points, e.g. [[0,0],[1,1],[2,1]] |