Пример #1
0
 // Instance Methods
 public double DotProduct(Vector3D a)
 {
     return a.x * x + a.y * y + a.z * z;
 }
Пример #2
0
 public Vector3D CrossProduct(Vector3D b)
 {
     double p = y * b.z - z * b.y;
     double q = z * b.x - x * b.z;
     double r = x * b.y - y * b.x;
     return new Vector3D(p, q, r);
 }
Пример #3
0
 public static Vector3D CrossProduct(Vector3D a, Vector3D b)
 {
     return a.CrossProduct(b);
 }
Пример #4
0
 // Static methods
 public static double DotProduct(Vector3D a, Vector3D b)
 {
     return a.DotProduct(b);
 }
Пример #5
0
 public Vector3D(Vector3D a)
 {
     x = a.x; y = a.y; z = a.z;
 }