No specific help this time, I'm afraid, but in general you'd use sin and cos with values like distance and angle between points.
For example, if the position of objectA is [50, 100] while the position of objectB is [200, 200] and the angle 0?, and you are now about to rotate objectB to 15?:
radius = distance(objectA.X, objectA.Y, objectB.X, objectB.Y)
relativeAngle = angle(objectB.X, objectB.Y, objectA.X, objectA.Y)
objectA's new rotated x = objectB.X + cos(relativeAngle + 15) * radius
objectA's new rotated y = objectB.Y + sin(relativeAngle + 15) * radius
Now that objectA is repositioned you can rotate objectB to 15?.
You need to work with buffers (pv for every value) when at the same time you not only want to rotate objectB, but move it also.
Then you would buffer distance and angle before moving objectB, then move objectB, then calculate objectA's new position and finally rotate objectB.
Very, very simple example cap: rotating_relative.cap