Package net.paulhertz.pixelaudio.curves
Class PAPathParametric
java.lang.Object
net.paulhertz.pixelaudio.curves.PAPathParametric
PAPathParametric
Parametric view of a polyline path (e.g., polygonized Bezier).
u ∈ [0,1] → (x(u), y(u))
For now, u is interpreted over the *index* of the point list:
- u = 0 → first point
- u = 1 → last point
- intermediate u → linear interpolation between neighboring points
This preserves any "bunching" of points in high-curvature regions
produced by the polygonization.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
points
-
count
private final int count
-
-
Constructor Details
-
PAPathParametric
- Parameters:
points- ordered points along the path (e.g., from getEventPoints) must contain at least 2 points.
-
-
Method Details
-
getPointCount
public int getPointCount() -
sample
public processing.core.PVector sample(float u) Sample the path at parameter u ∈ [0,1], returning an interpolated point. u is clamped to [0,1]. -
lerp
private static processing.core.PVector lerp(processing.core.PVector a, processing.core.PVector b, float u)
-