# Confusion in computing relative velocities between different coordinate frames [closed]

I am writing a tree structure and I am trying to compute velocity between different frames on my own. But, I feel like my computation is wrong and was wondering if you guys can help me figure out what's wrong.
**2**

```
B x
\ (5,3,1) |
\ y <___|
1
\ (2,1,0) x
\ |
2 |____>Z
```

I was unable to attach an image, hence put that diagram above as an example. Note that frame 2 is rotated along roll w.r.t frame 1. Frame B and Frame 1 have same coordinate axis(X pointing up, +ve Y pointing to the left and +ve Z is coming out of the paper) and hence their total velocity will add up. So

```
relative velocity of B to 1 is (7,4,1).
```

But in the case of relative velocity of frame 1 and 2, frame 2 is rolled by +90 degrees and hence it's -ve Z axis is +ve Y axis of frame 1. I was asked to consider the velocities mentioned in that tree link as relative velocities between a child and a parent. That means, the relative velocity between frame 1 and 2 is (2,1,0).

My confusion is,

- Does that mean that the X value 2, at the velocity vector is actually -Z value of frame 2?
- How to compute the relative velocity between frame 2 to frame B.
- Where can I learn more stuff about this?

I understand we need to include transformation matrices between frame 2 and 1 into account. But I am not sure how to incorporate it.

Any pointers that will help me understand this better will be greatly appreciated. Thank you!

This doesn't seem ROS related. I'd recommend reading up on "homogeneous transformation matrix". There's a book you can find a PDF of that does a good introduction: Introduction to Robotics by John J Craig. Its written very approachably.

Closing ticket since non-ROS