w=diffTrotz(TA,TB)
TA : | Frame A | |
TB : | Frame b |
w : | relative rotation of Bx relative to Ax |
diffTrotz(eye(4),TofR(rot(0,0,pi/10),[0 0 1]))
This function, diffTrotz
, calculates the relative rotation of the ez
vector of frame B with respect to frame A. It is part of the SG-Library and was introduced in SolidGeometry 5.1.
TBW
by multiplying the inverse of TA
with TB
:
TBW = TA\TB;
w
using the atan2
function on the elements of TBW
:
w = atan2(TBW(2,1), TBW(1,1));
w
to five decimal places:
w = round(w, 5);
nargout == 0
), perform the following visualization steps:
s
using the function sofBB
and BBofVL
:
s = (sofBB(BBofVL([TA(1:3,4)'; TB(1:3,4)'])) + 1) / 4;
SGfigure
:
SGfigure(-30, 30);
TA
and TB
using tplot
with different scaling factors:
tplot(TA, s, '', 'A');
tplot(TB, s * 0.6, '', 'B');
To calculate the relative rotation for a specific transformation, use:
diffTrotz(eye(4), TofR(rot(0, 0, pi/10), [0 0 1]));Algorithm explaination created using ChatGPT on 2025-08-19 00:02. (Please note: No guarantee for the correctness of this explanation)