# Do I need to use Inverse Kinematics if I have the coordinates of all joints?

So I have the positions of all the joints (x,y,z) of a robot arm. I need to calculate the angles of the joints to feed them to another similar robot arm. I cannot get the angles from the robot I need to calculate them from the positions.

Let's say:

J1: (x1,y1,z1)-------------J2: (x2,y2,z2)----------------End: (x3,y3,z3)

x is the depth towards the screen, z is vertical axis and y is horizontal axis

let's say J1 rotates around y1 and x1, and J2 rotates around x2 and z2

My first instinct is, this is easy! I just need to calculate the angles between (x1,y1,z1) and (x2,y2,z2) to get the angles of J1, and between (x2,y2,z2) and (x3,y3,z3) to get the angles of J2.

For J1: I use atan (x1/z1) to get the angle around y1 and atan (z1/y1) for the angle around x1.

For J2: angle around x2 = atan (z2/y2). angle around z2 = atan (y2/x2).

Now I know I'm wrong, because this didn't work. Also because if this works, why would people use complex inverse kinematics solutions. The problem is, I have no idea why this is wrong. Can someone explain to me the mistakes in my method/understanding?

Thank you.

The refrence arm: The controlled arm: I forgot to add joints labels from top to bottom (J1, J2, End) I'm controlling the arm by rotating around the y-axis and around the x-axis of J1 for J1-J2 and around the z-axis and around the x-axis of J2 for J2-End.

• Drawing does not match the text. "Let's say J1 rotates around y1 and x1, and J2 rotates around x2 and z2" seems like J2 is rotating around y2 and x2 from the drawing and the later description "J2 and around the z-axis and around the x-axis of J2 for J2-End." – 50k4 Aug 20 '19 at 9:42
• also, the difference between the reference arm and controled arm is unclear – 50k4 Aug 20 '19 at 9:43
• @50k4 Ok, I think I'm not explaining this correctly, I'll rephrase the question to be more simple. Forgetting everything I said before. I have a 3D vector v1, from the origin to point (x1,y1,z1). Say I want to rotate another vector v2 from the same origin (the magnitude doesn't matter), to match the direction of v1. The initial direction of v2 is along the z axis and I want to rotate it around x and y to match v1. Is it correct do it using: rot_x = atan2(z,y) and rot_y = atan2(z,x) ? – da silva Aug 21 '19 at 10:40
• So..this is another question... Then please post is accordingly... – 50k4 Aug 22 '19 at 8:43

People use complex inverse kinematics because they do not have the joint positions. In the case of an industrial robto, you know the you want the end effector at a certain position, and you calculate (or the robot's software) calculates what joint angles correspond for that position. (actually one of the ways of doing this is to calculate the xyz position of some joints and calculate angles from those coordinates)