public Vector(Vector rhs) { x = rhs.x; y = rhs.y; z = rhs.z; }
Vector theVector; // Vector object that this enumerato refers to #endregion Fields #region Constructors public VectorEnumerator(Vector theVector) { this.theVector = theVector; location = -1; }
static void Main(string[] args) { Vector Vect1 = new Vector(1.0, 2.0, 5.0); foreach (double Component in Vect1) { foreach (double Next in Vect1) Console.Write(" " + Next); Console.WriteLine(Component); } Console.ReadLine(); }
public static Vector operator +(Vector lhs, Vector rhs) { Vector Result = new Vector(lhs); Result.x += rhs.x; Result.y += rhs.y; Result.z += rhs.z; return Result; }