One way is to take a coordinate system that is
initially coincident with $A$, and then apply various
rotations and translations to make it coincide with $B.$
Then a description of all the rotations and translations will
give the required relation. Unfortunately, there are infinitely
many different ways to achieve this. To regularise things, we
shall always proceed in this order: first a rotation around
the $z$-axis of $A.$ This must be followed by a
rotation around the $y$-axis of $A.$ Then comes a
rotation around the $x$-axis of $A.$ Finally we shall
apply a translation.
A mmathematician named Euler showed that you can always go from
any $A$ to any $B$ using these steps. So the
description now is a list of 6 numbers: three rotations and the
translation (which is specified by 3 numbers, the components
along the $x$-, $y$- and $z$-axes of $A$). We
shall call the tranlation numbers the
position and the
rotations numbers the
orientation.
Unfortunetely, the orientation is not uniquely determined
by $A$ and $B.$ But this will not cause any problem for us.
For a cuboid or sphere it is
indeed the obvious centre, for a cone it is half way between the
apex and the centre of the base. In general, I suspect that it is at the centre
of the bounding box for the object at the time of its
creation. The bounding box is aligned with the global coordinate
system. You can always check the local origin by clicking the
Orbit tool while the object is selected.
of the object and the axes are more or less along the
lines of symmetry.