Rotation in another system coordinate

Good day.

We always have a coordinate system relative to which the transform of the object scene...

In scene precent $Box01 and TARGET CAMERA $Camera01.

$Box01 for 50 frames, has moved to a new position, and turned by an arbitrary angle.$Camera01 for animation remained motionless.

Now I want to convert this animation in the coordinate system $Box01. Box during the animation remains stationary, but is moving the camera.

To obtain the value of the $Camera01 position relative to the $Box01, we can write
-----------------------------------------------------------------------------
varArrayCamPos=#()
varArrayCamTargetPos=#()
for t=animationRange.start to animationRange.end by 1 do(
sliderTime=t
at time t
varPOS=in coordsys $Box01 $Camera01.pos
varTargetPos=in coordsys $Box01 $Camera01.Target.pos
append varArrayCamPos varPOS
append varArrayCamTargetPos varTargetPos
)
for t=animationRange.start to animationRange.end by 1 do(
sliderTime=t
at time t
varNum=sliderTime as integer/TicksPerFrame+1
set animate on
$Box01.pos=[0,0,0]
in coordsys $Box01 $Camera01.pos=varArrayCamPos[varNum]
in coordsys $Box01 $Camera01.Target.pos=varArrayCamTargetPos[varNum]
set animate off
)
---------------------------------
How to get rotation angles of the $Camera01 in the coordinate system $Box01 to the camera movement relative to the box, gave the same result in viewport?
(Box during the animation remains stationary and the camera rotates)