public static Matrix Lerp(Matrix a, Matrix b, float t) { var row1 = new Vector4( MathHelpers.Lerp(a.M11, b.M11, t), MathHelpers.Lerp(a.M12, b.M12, t), MathHelpers.Lerp(a.M13, b.M13, t), MathHelpers.Lerp(a.M14, b.M14, t)); var row2 = new Vector4( MathHelpers.Lerp(a.M21, b.M21, t), MathHelpers.Lerp(a.M22, b.M22, t), MathHelpers.Lerp(a.M23, b.M23, t), MathHelpers.Lerp(a.M24, b.M24, t)); var row3 = new Vector4( MathHelpers.Lerp(a.M31, b.M31, t), MathHelpers.Lerp(a.M32, b.M32, t), MathHelpers.Lerp(a.M33, b.M33, t), MathHelpers.Lerp(a.M34, b.M34, t)); var row4 = new Vector4( MathHelpers.Lerp(a.M41, b.M41, t), MathHelpers.Lerp(a.M42, b.M42, t), MathHelpers.Lerp(a.M43, b.M43, t), MathHelpers.Lerp(a.M44, b.M44, t)); return(new Matrix(row1, row2, row3, row4)); }
public static Vector4 Lerp(Vector4 u, Vector4 v, float a) => new Vector4( MathHelpers.Lerp(u.X, v.X, a), MathHelpers.Lerp(u.Y, v.Y, a), MathHelpers.Lerp(u.Z, v.Z, a), MathHelpers.Lerp(u.W, v.W, a));
public static Vector3 Lerp(Vector3 v, Vector3 w, float a) => new Vector3( MathHelpers.Lerp(v.X, w.X, a), MathHelpers.Lerp(v.Y, w.Y, a), MathHelpers.Lerp(v.Z, w.Z, a));
public static Vector2 Lerp(Vector2 v, Vector2 w, float a) => new Vector2( MathHelpers.Lerp(v.X, w.X, a), MathHelpers.Lerp(v.Y, w.Y, a));