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); }
public Vector3D(Vector3D a) { x = a.x; y = a.y; z = a.z; }
public Vector3D UnitNormalVector(Vector3D a) { return new Vector3D (this.Cross(a)).UnitVector(); }
public Vector3D Sub(Vector3D a) { return new Vector3D(x - a.x, y -a.y, z - a.z); }
public double Dot(Vector3D a) { return x * a.x + y * a.y + z * a.z; }
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); }
public Vector3D Add(Vector3D a) { return new Vector3D(x + a.x, y + a.y, z + a.z); }