示例#1
0
 public static float Dot(Vector v, Normal n)
 {
     if (v.HasNaNs() || n.HasNaNs()) throw new InvalidOperationException();
     return v.x * n.x + v.y * n.y + v.z * n.z;
 }
示例#2
0
 public static float Dot(Normal n, Vector v)
 {
     if (n.HasNaNs() || v.HasNaNs()) throw new InvalidOperationException();
     return n.x * v.x + n.y * v.y + n.z * v.z;
 }
示例#3
0
 public static Vector Cross(Vector v1, Vector v2)
 {
     if (v1.HasNaNs() || v2.HasNaNs()) throw new InvalidOperationException();
     return new Vector((v1.y * v2.z) - (v1.z * v2.y), (v1.z * v2.x) - (v1.x * v2.z), (v1.x * v2.y) - (v1.y * v2.x));
 }
示例#4
0
 public static float Dot(Vector v1, Vector v2)
 {
     if (v1.HasNaNs() || v2.HasNaNs()) throw new InvalidOperationException();
     return v1.x * v2.x + v1.y * v2.y + v1.z * v2.z;
 }
示例#5
0
 public static float AbsDot(Vector v1, Vector v2)
 {
     if (v1.HasNaNs() || v2.HasNaNs()) throw new InvalidOperationException();
     return Math.Abs(Dot(v1, v2));
 }