Hello

I am attempting to rotate a XYZ point around the base point. I have some code that attempts to do this but its producing the incorrect result.

How do you rotate a XYZ point around the base point?

As a test, my project's base point is (100, 100, 0) with an angle to true north of 60 degrees. I attempt to rotate the XYZ point (110, 110, 0) around this base point by 60 degrees. The result should be (113.66, 96.33, 0) but my code produces (73.4, 246.6, 0).

Any ideas what I am doing wrong?

Code:
// Obtain Base Point Position
XYZ             origin          = new XYZ(0, 0, 0);
ProjectLocation projectLocation = doc.ActiveProjectLocation;
ProjectPosition position        = projectLocation.get_ProjectPosition(origin);

// Rotate the point (110,110,0) around the base point (100,100,0) where the angle is 60 degrees
Transform rot         = Transform.CreateRotationAtPoint(XYZ.BasisZ,  position.Angle, new XYZ(position.EastWest, position.NorthSouth,  position.Elevation));
Transform pos         = Transform.get_Translation( new XYZ(110, 110, 0) );
Transform rotPos     = pos.Multiply(rot);

// Correct rotation should be (113.66,96.33,0) but the result gives (73.4,246.6,0)
TaskDialog.Show("Result: ", string.Format("{0}, {1}, {2}", rotPos.Origin.X, rotPos.Origin.Y, rotPos.Origin.Z));