# Rotating Vector3d instances

I’m trying to understand how transforms work with Vector3d items, I made a new transform, a rotation around the x axis by r radians

``````var t = new Transform
{
M00 = 1, M01 = 0, M02 = 0, M03 = 0,
M10 = 0, M11 = Math.Cos(r), M12 = -Math.Sin(r), M13 = 0,
M20 = 0, M21 = Math.Sin(r), M22 = Math.Cos(r), M23 = 0,
M30 = 0, M31 = 0, M32 = 0, M33 = 1
};

var c = new Vector3d {0, 0, 1};

// This works fine, c is rotated as expected
c = t * c;

// this doesn't work, c is never updated
c.Transform(t);
``````

What am I missing?

Patrick.

Hello.
It is a constructor method, so I think it is (), not {}.

` var c = new Vector3d ( 0, 0, 1 );`

I’m working in RhinoCommon btw, should have mentioned that previously.

I’ve found a fix for the behaviour I was seeing, I was using a Vector3d property rather than a field and that seems to prevent the Vector3d being transformed by the rotate method.

``````private Vector3d MyAxis{ get; set; }
private Vector3d _myAxis;
...
var axisOfRotation = new Vector3d(1, 0, 0);
var r = (Math.PI / 180) * 45;

MyAxis = new Vector3d(0, 0, 1);
MyAxis.Rotate(r, axisOfRotation); // MyAxis isn't changed

_myAxis = new Vector3d(0, 0, 1);
_myAxis.Rotate(r, axisOfRotation); // _myAxis is rotated to a new position``````