/// <summary>
 /// Returns the curve coordinate given by 4 points and a time value.
 /// </summary>
 /// <param name="p0">The start point.</param>
 /// <param name="p1">The first control point.</param>
 /// <param name="p2">The second control point.</param>
 /// <param name="p3">The end point.</param>
 /// <param name="t">A value between 0 and 1.</param>
 public static Vector2 Point(Vector2 p0, Vector2 p1, Vector2 p2, Vector2 p3, float t)
 {
     return(CubicBezierCurve3D.Point(
                new Vector3(p0.X, p0.Y, 0),
                new Vector3(p1.X, p1.Y, 0),
                new Vector3(p2.X, p2.Y, 0),
                new Vector3(p3.X, p3.Y, 0),
                t
                ).XY());
 }
Exemplo n.º 2
0
 /// <summary>
 /// Returns the instantaneous velocity given by 3 points and a normalized time value.
 /// </summary>
 /// <param name="p0">The start point.</param>
 /// <param name="p1">The control point.</param>
 /// <param name="p2">The end point.</param>
 /// <param name="t">A value between startTime and endTime.</param>
 /// <param name="startTime"></param>
 /// <param name="endTime"></param>
 public static Vector3 Velocity(Vector3 p0, Vector3 p1, Vector3 p2, float t, float startTime, float endTime)
 {
     var(cubicP0, cubicP1, cubicP2, cubicP3) = AsCubic(p0, p1, p2);
     return(CubicBezierCurve3D.Velocity(cubicP0, cubicP1, cubicP2, cubicP3, t, startTime, endTime));
 }
Exemplo n.º 3
0
 /// <summary>
 /// Returns the instantaneous velocity given by 3 points and a normalized time value.
 /// </summary>
 /// <param name="p0">The start point.</param>
 /// <param name="p1">The control point.</param>
 /// <param name="p2">The end point.</param>
 /// <param name="t">A value between 0 and 1.</param>
 public static Vector3 Velocity(Vector3 p0, Vector3 p1, Vector3 p2, float t)
 {
     var(cubicP0, cubicP1, cubicP2, cubicP3) = AsCubic(p0, p1, p2);
     return(CubicBezierCurve3D.Velocity(cubicP0, cubicP1, cubicP2, cubicP3, t));
 }