public static float Dot(Vector4D left, Vector4D right) { return(left.X * right.X + left.Y * right.Y + left.Z * right.Z + left.W * right.W); }
public static float Distance(Vector4D left, Vector4D right) { return(Length(left - right)); }
public static Vector4D Normalize(Vector4D source) { return(source / Length(source)); }
public static float Length(Vector4D source) { return((float)Math.Sqrt(source.X * source.X + source.Y * source.Y + source.Z * source.Z + source.W * source.W)); }
public static float SquareLength(Vector4D source) { return(source.X * source.X + source.Y * source.Y + source.Z * source.Z + source.W * source.W); }
public static Vector4D Pow(Vector4D left, Vector4D right) { return(new Vector4D((float)Math.Pow(left.X, right.X), (float)Math.Pow(left.Y, right.Y), (float)Math.Pow(left.Z, right.Z), (float)Math.Pow(left.W, right.W))); }
public static Vector4D Sign(Vector4D source) { return(new Vector4D(Math.Sign(source.X), Math.Sign(source.Y), Math.Sign(source.Z), Math.Sign(source.W))); }
public static Vector4D Max(Vector4D left, Vector4D right) { return(new Vector4D(Math.Max(left.X, right.X), Math.Max(left.Y, right.Y), Math.Max(left.Z, right.Z), Math.Max(left.W, right.W))); }
public static Vector4D Mix(Vector4D left, Vector4D right, float val) { return(left * (1 - val) + right * val); }
public static Vector4D Mod(Vector4D left, Vector4D right) { return(left - right * Floor(left / right)); }
public static Vector4D Max(Vector4D source, float val) { return(new Vector4D(Math.Max(source.X, val), Math.Max(source.Y, val), Math.Max(source.Z, val), Math.Max(source.W, val))); }
public static Vector4D Mod(Vector4D source, float val) { return(source - val * Floor(source / val)); }
public static Vector4D Ceiling(Vector4D source) { return(new Vector4D((float)Math.Ceiling(source.X), (float)Math.Ceiling(source.Y), (float)Math.Ceiling(source.Z), (float)Math.Ceiling(source.W))); }
public static Vector4D Floor(Vector4D source) { return(new Vector4D((float)Math.Floor(source.X), (float)Math.Floor(source.Y), (float)Math.Floor(source.Z), (float)Math.Floor(source.W))); }
public static Vector4D Reflect(Vector4D incident, Vector4D normal) { return(incident - 2 * Dot(normal, incident) * normal); }
public static Vector4D Step(Vector4D source, float edge) { return(new Vector4D(Util.Step(source.X, edge), Util.Step(source.Y, edge), Util.Step(source.Z, edge), Util.Step(source.W, edge))); }
public static Vector4D Atan(Vector4D source) { return(new Vector4D((float)Math.Atan(source.X), (float)Math.Atan(source.Y), (float)Math.Atan(source.Z), (float)Math.Atan(source.W))); }
public static Vector4D Step(Vector4D source, Vector4D edge) { return(new Vector4D(Util.Step(source.X, edge.X), Util.Step(source.Y, edge.Y), Util.Step(source.Z, edge.Z), Util.Step(source.W, edge.W))); }
public static Vector4D Sqrt(Vector4D source) { return(new Vector4D((float)Math.Sqrt(source.X), (float)Math.Sqrt(source.Y), (float)Math.Sqrt(source.Z), (float)Math.Sqrt(source.W))); }
public static Vector4D Abs(Vector4D source) { return(new Vector4D(Math.Abs(source.X), Math.Abs(source.Y), Math.Abs(source.Z), Math.Abs(source.W))); }