public void Should_CalculatePoint_ForQuadBezier3rdQtrStep() { var step = 0.75; var p = Interpolate.Bezier( new Vector3d(0.0, 0.0, 0.0), new Vector3d(1.0, 1.0, 1.0), new Vector3d(0.5, 0.5, 0.5), step ); Assert.AreEqual(new Vector3d(0.75, 0.75, 0.75), p); }
public void Should_CalculatePoint_ForCubeBezierFullStep() { var step = 1.0; var p = Interpolate.Bezier( new Vector3d(0.0, 0.0, 0.0), new Vector3d(1.0, 1.0, 1.0), new Vector3d(0.5, 0.5, 0.5), new Vector3d(-0.5, -0.5, -0.5), step ); Assert.AreEqual(new Vector3d(1.0, 1.0, 1.0), p); }
// Token: 0x06000452 RID: 1106 RVA: 0x00022ECC File Offset: 0x000210CC private static IEnumerable <Vector3> NewBezier <T>(Interpolate.Function ease, IList nodes, Interpolate.ToVector3 <T> toVector3, float maxStep, IEnumerable <float> steps) { if (nodes.Count >= 2) { Vector3[] points = new Vector3[nodes.Count]; foreach (float elapsedTime in steps) { for (int i = 0; i < nodes.Count; i++) { points[i] = toVector3((T)((object)nodes[i])); } yield return(Interpolate.Bezier(ease, points, elapsedTime, maxStep)); } IEnumerator <float> enumerator = null; points = null; } yield break; yield break; }
/// <summary> /// Calculates the point on the Bezier curve at parameter t. /// </summary> /// <param name="t">The arc parameter t.</param> /// <returns>The Euclidean coordinates of the point on the curve at parameter t.</returns> protected override Vector2 getPointAt(float t) { return(Interpolate.Bezier(p0, p1, p2, p3, t)); }