Пример #1
0
 static void CreateNewVector3D(List<Vector3D> a)
 {
     Console.WriteLine("You have selected create new vector3D");
     double x, y, z;
     Console.Write("x= "); x = double.Parse(Console.ReadLine());
     Console.Write("y= "); y = double.Parse(Console.ReadLine());
     Console.Write("z= "); z = double.Parse(Console.ReadLine());
     Vector3D w = new Vector3D(x, y, z);
     a.Add(w);
     Console.WriteLine(w);
 }
Пример #2
0
 public Vector3D(Vector3D a)
 {
     x = a.x; y = a.y; z = a.z;
 }
Пример #3
0
 public Vector3D UnitNormalVector(Vector3D a)
 {
     return new Vector3D (this.Cross(a)).UnitVector();
 }
Пример #4
0
 public Vector3D Sub(Vector3D a)
 {
     return new Vector3D(x - a.x, y -a.y, z - a.z);
 }
Пример #5
0
 public double Dot(Vector3D a)
 {
     return x * a.x + y * a.y + z * a.z;
 }
Пример #6
0
 public Vector3D Cross(Vector3D a)
 {
     return new Vector3D(y * a.z - z * a.y, z * a.x - x * a.z, x * a.y - y * a.x);
 }
Пример #7
0
 public Vector3D Add(Vector3D a)
 {
     return new Vector3D(x + a.x, y + a.y, z + a.z);
 }