How to write an efficient remap planes function in python?

I am trying to make a function that takes in a reference plane, a target plane and a plane to remap (I’ll call it planeA).

So that the spatial relationship of the planeA to reference_plane is the same as the returned plane is to the target plane.

I also want to be able to scale the distance from the target plane to the returned plane.

Can anybody suggest the functions I need to look into to build this? I want to have it as efficient as possible as I am using this roughly 10000 times each time I change one variable in grasshopper.

Hi Jake

rhinoscriptsyntax.XformRotation1 (initial_plane, final_plane)
Ciao Vittorio

Oh thanks! I had never looked at those Xform methods.