/// <summary> /// /// </summary> /// <param name="v0"></param> /// <param name="v1"></param> /// <returns></returns> public static Vec3i Cross(Vec3i v0, Vec3i v1) { return(new Vec3i( v0.Y * v1.Z - v0.Z * v1.Y, v0.Z * v1.X - v0.X * v1.Z, v0.X * v1.Y - v0.Y * v1.X)); }
/// <summary> /// /// </summary> /// <param name="v"></param> /// <param name="t"></param> /// <returns></returns> public static Vec3i Min(Vec3i v, int t) { return(new Vec2i(Math.Min(v.X, t), Math.Min(v.Y, t))); }
/// <summary> /// /// </summary> /// <param name="v0"></param> /// <param name="v1"></param> /// <returns></returns> public static double Dot(Vec3i v0, Vec3i v1) { return(v0.X * v1.X + v0.Y * v1.Y + v0.Z * v1.Z); }
/// <summary> /// /// </summary> /// <param name="v0"></param> /// <param name="v1"></param> /// <returns></returns> public static Vec3i Min(Vec3i v0, Vec3i v1) { return(new Vec3i(Math.Min(v0.X, v1.X), Math.Min(v0.Y, v1.Y), Math.Min(v0.Z, v1.Z))); }
/// <summary> /// /// </summary> /// <returns></returns> public static Vec3i Abs(Vec3i v) { return(new Vec3i(Math.Abs(v.X), Math.Abs(v.Y), Math.Abs(v.Z))); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public int ManhattanDistanceTo(Vec3i other) { other -= this; return(other.ManhattanLength); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public int SquareDistanceTo(Vec3i other) { other -= this; return(other.SquareLength); }
/// <summary> /// /// </summary> /// <param name="other"></param> /// <returns></returns> public double DistanceTo(Vec3i other) { other -= this; return(other.Length); }