# Changebasis giving odd results

Transform.changebasis seems to be giving me incorrect results, unless I’m misunderstanding somewhere here… I have two planes with a shared origin but different normals. I take a sphere with the same origin, and transform it via change basis from one plane to the next. I would expect the sphere to just rotate, but it translates too.

Any idea whats going on?
Thanks,
Sam

``````        'create the start plane
Dim StartPlane = New Plane(New Point3d(50, 30, 20), New Vector3d(0, 0, 1))
Dim StartPlaneSurface As New PlaneSurface(StartPlane, New Interval(-111, 111), New Interval(-111, 111))

'create the end plane
Dim EndPlane = New Plane(New Point3d(50, 30, 20), New Vector3d(1, 1, 1))
Dim EndPlaneSurface As New PlaneSurface(EndPlane, New Interval(-111, 111), New Interval(-111, 111))

'create the transform
Dim xform = Transform.ChangeBasis(EndPlane, StartPlane)

'create the initial sphere
Dim spherestart As New Rhino.Geometry.Sphere(New Point3d(50, 30, 20), 50)

'transform the sphere
spherestart.Transform(xform)

I think you want Transform.PlaneToPlane().

Great, that works, thanks.

I’m still wondering though, does change basis only achieve orientation and not position? I thought the point was to change coordinate systems… I ask because I’ve used it previously and might have to go back and fix what I’ve done.

Thanks,
Sam

my understanding is change basis gives you back the transform that would give you the current location, but in the other coordinate system…so this “moves” the object when applied. I think that implies that a for a change basis to only create a rotation of the object, the origins(and orientations) would have to be different for the two planes(effectively the second plane rotated around the center of the sphere).

OK, I will use the plane method from now on.

Thanks!
Sam

There’s a good explanation of this over at the GH forum: http://www.grasshopper3d.com/xn/detail/2985220:Comment:656329