I have been reading about immutable types, and how that it is not recommended to have a mutable struct.

What if I have a class instead:

```
public class Vector
{
public double X, Y;
public void Rotate(double angle)
{
double x = this.X; double y = this.Y;
this.X = (float)((Math.Cos(angle) * x) - (Math.Sin(angle) * y));
this.Y = (float)((Math.Sin(angle) * x) + (Math.Cos(angle) * y));
}
}
```

So this will be called as:

```
Vector v = new Vector(1,0);
v.rotate(Math.PI / 2.0);
```

In this case, should I have written like this instead?

```
public class Vector
{
public double X, Y;
public Vector Rotate(double angle)
{
double x = this.X; double y = this.Y;
return new Vector((float)((Math.Cos(angle) * x) - (Math.Sin(angle) * y)), (float)((Math.Sin(angle) * x) + (Math.Cos(angle) * y)));
}
}
```

To be called as:

```
Vector v = new Vector(1,0);
Vector v2 = v.rotate(Math.PI / 2.0);
```