get-medial-point-coeffs-bez1
function getMedialPointCoeffsBez1(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-bez1.ts:21
Returns the polynomial coefficients used to recover ray parameter values t
for a ray q(t) = p + t⋅v and an order-1 bezier curve ps.
The returned polynomials encode the medial-condition equations in s and
t. For any valid solution, t is recovered by eliminating s and solving
the resulting ray equation, or equivalently by using the linear form
A(s)⋅t + B(s) = 0, which gives t = -B(s)/A(s).
More specifically, the returned values represent:
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 vector starting from p |
ps | number[][] | order 1 bezier control points, i.e. a line segment given as an array of control points, e.g. [[0,0],[2,1]] |