public void CosineInterpolationDoublePrecision()
 {
     Assert.AreEqual(1.0, InterpolationHelper.CosineInterpolation(1.0, 2.0, 0.0));
     Assert.AreEqual(1.5, InterpolationHelper.CosineInterpolation(1.0, 2.0, 0.5));
     Assert.AreEqual(2.0, InterpolationHelper.CosineInterpolation(1.0, 2.0, 1.0));
     Assert.AreEqual(1.5, InterpolationHelper.CosineInterpolation(2.0, 1.0, 0.5));
 }
 public void CosineInterpolationSinglePrecision()
 {
     Assert.AreEqual(1.0f, InterpolationHelper.CosineInterpolation(1.0f, 2.0f, 0.0f));
     Assert.AreEqual(1.5f, InterpolationHelper.CosineInterpolation(1.0f, 2.0f, 0.5f));
     Assert.AreEqual(2.0f, InterpolationHelper.CosineInterpolation(1.0f, 2.0f, 1.0f));
     Assert.AreEqual(1.5f, InterpolationHelper.CosineInterpolation(2.0f, 1.0f, 0.5f));
 }
        public void CosineInterpolationVectorD()
        {
            VectorD v      = new VectorD(new[] { 1.0, 10.0, 100.0, 1000.0 });
            VectorD w      = new VectorD(new[] { 2.0, 20.0, 200.0, 2000.0 });
            VectorD lerp0  = InterpolationHelper.CosineInterpolation(v, w, 0.0);
            VectorD lerp1  = InterpolationHelper.CosineInterpolation(v, w, 1.0);
            VectorD lerp05 = InterpolationHelper.CosineInterpolation(v, w, 0.5);

            Assert.AreEqual(v, lerp0);
            Assert.AreEqual(w, lerp1);
            Assert.IsTrue(VectorD.AreNumericallyEqual(new VectorD(new[] { 1.5, 15.0, 150.0, 1500.0 }), lerp05));
        }
        public void CosineInterpolationVectorF()
        {
            VectorF v      = new VectorF(new[] { 1.0f, 10.0f, 100.0f, 1000.0f });
            VectorF w      = new VectorF(new[] { 2.0f, 20.0f, 200.0f, 2000.0f });
            VectorF lerp0  = InterpolationHelper.CosineInterpolation(v, w, 0.0f);
            VectorF lerp1  = InterpolationHelper.CosineInterpolation(v, w, 1.0f);
            VectorF lerp05 = InterpolationHelper.CosineInterpolation(v, w, 0.5f);

            Assert.AreEqual(v, lerp0);
            Assert.AreEqual(w, lerp1);
            Assert.AreEqual(new VectorF(new[] { 1.5f, 15.0f, 150.0f, 1500.0f }), lerp05);
        }
        public void CosineInterpolationVector4()
        {
            Vector4 v      = new Vector4(1.0f, 10.0f, 100.0f, 1000.0f);
            Vector4 w      = new Vector4(2.0f, 20.0f, 200.0f, 2000.0f);
            Vector4 lerp0  = InterpolationHelper.CosineInterpolation(v, w, 0.0f);
            Vector4 lerp1  = InterpolationHelper.CosineInterpolation(v, w, 1.0f);
            Vector4 lerp05 = InterpolationHelper.CosineInterpolation(v, w, 0.5f);

            Assert.AreEqual(v, lerp0);
            Assert.AreEqual(w, lerp1);
            Assert.AreEqual(new Vector4(1.5f, 15.0f, 150.0f, 1500.0f), lerp05);
        }
 public void CosineInterpolationVectorDException3()
 {
     InterpolationHelper.CosineInterpolation(new VectorD(3), new VectorD(4), 0);
 }
 public void CosineInterpolationVectorDException2()
 {
     InterpolationHelper.CosineInterpolation(new VectorD(), null, 0);
 }
 public void CosineInterpolationVectorFException()
 {
     InterpolationHelper.CosineInterpolation(null, new VectorF(), 0);
 }