Example #1
0
        public override SEGMENT GetPoint(Single offset)
        {
            var sample = FindSample(offset);

            switch (sample.A.Degree)
            {
            case 0:
                return(sample.A.Point);

            case 1:
                return(new SEGMENT(CurveSampler.InterpolateLinear(sample.A.Point, sample.B.Point, sample.Amount)));

            case 3:
                return(new SEGMENT(CurveSampler.InterpolateCubic
                                   (
                                       sample.A.Point, sample.A.OutgoingTangent,
                                       sample.B.Point, sample.B.IncomingTangent,
                                       sample.Amount
                                   )));

            default:
                throw new NotSupportedException();
            }
        }
Example #2
0
 public SEGMENT InterpolateLinear(SEGMENT left, SEGMENT right, float amount)
 {
     return(new SEGMENT(CurveSampler.InterpolateLinear(left, right, amount)));
 }
Example #3
0
 public float[] InterpolateLinear(float[] left, float[] right, float amount)
 {
     return(CurveSampler.InterpolateLinear(left, right, amount));
 }