Click or drag to resize

CardinalSplineToBezierSegmentConverterShortenBezierSegment Method

Shortens a Bezier segment in parameter space and returns the Bezier control points of the shortened segment.

Namespace: Altaxo.Geometry
Assembly: AltaxoCore (in AltaxoCore.dll) Version: 4.8.3448.0 (4.8.3448.0)
Syntax
C#
public static Tuple<PointD2D, PointD2D, PointD2D, PointD2D> ShortenBezierSegment(
	PointD2D P1,
	PointD2D P2,
	PointD2D P3,
	PointD2D P4,
	double t0,
	double t1
)

Parameters

P1  PointD2D
Endpoint P1 of the original Bezier segment.
P2  PointD2D
Control point P2 of the original Bezier segment.
P3  PointD2D
Control point P3 of the original Bezier segment.
P4  PointD2D
Endpoint P4 of the original Bezier segment.
t0  Double
Start parameter in range [0, 1].
t1  Double
End parameter in range [0, 1], must be greater than t0.

Return Value

TuplePointD2D, PointD2D, PointD2D, PointD2D
The control points of the shortened Bezier segment (PS1, PS2, PS3, PS4).
Remarks

See this source http://stackoverflow.com/questions/11703283/cubic-bezier-curve-segment for explanation.

The assumption here is that the Bezier curve is parametrized using

B(t) = (1−t)³ P1 + 3(1−t)² t P2 + 3(1−t) t² P3 + t³ P4

See Also