I'm working on some simulation code in C#, and I have some code along the lines of:

```
public void predict(Point start, Point end)
{
    end.velocity = start.velocity + dt * end.acceleration;
    end.position = start.position + dt * end.velocity;
}

```

Where position, velocity, acceleration are some vector data types I defined with associated operators.

As well as code where I'm doing:

```
StartPoint = EndPoint;
EndPoint = CurrentPoint;

```

With the \*Points being instances of Points that have several primitive (double) and non-primitive (Vector) data types.

I'm running into the (obvious) issue that the above code, most likely will simply just set StartPoint to point to the data that was previously EndPoint, and EndPoint will point to CurrentPoint.

Meaning, if I modify CurrentPoint again I'll end up accidentally modifying EndPoint.

In C++ this is simple to prevent since I can define my assignment operator to do a deep copy of the underlying data within my Point objects. How can I prevent this in C#?

Thanks for any help!

Edit: The Vector class is defined as

```
[Serializable]
public class Vector
{
    private Double[] data = new Double[Constants.Dimensions];

    ... snip ...

    public static Vector operator +(Vector lhs, Vector rhs)
    {
        Vector result = new Vector();
        for (UInt32 i = 0; i < Constants.dimensions; i++)
            result[i] = lhs[i] + rhs[i];
        return result;
    }

    lots more code here 
}

```