- Home /

# Inverse kinematics, how to invert the elbow joint? 2D, 2 Joint solution

I’ll start by saying I am horrible at all but the most basic of math problems. I’m trying to create some IK solutions to get over my habit of avoiding maths wherever possible.

I currently have an analytical solution for a 2D arm with 2 rotating joints (which is working!), calculating the internal angles [a] and [b] using the law of cosines.

I was able to understand the relationship between the equation and triangle sides and internal angles to find one solution, **but I would like to be able to also find the ‘inverted path’, shown by the grey dotted line. **

I’m struggling to visualise how the triangle can be ‘flipped’ so angles [d] and [e] can be calculated.

*Please see my mspaint artistry for a reference.*

Currently, I find the triangle edge lengths [A] [B] and [C]. Use these to calculate interior angles [a] and [b] needed to reach the target. Then apply rotation to the arm joints to move the end effector to the target.

I feel as though I should be able to use values already calculated in the solution and modify them to give the ‘inverted path’ (and that this can’t be any more difficult than what I have made already), but I am stuck!

I have tried Wikipedia, blog tutorials, youtube tutorials, inverse kinematics papers – very scary, and even thought about buying a math book for a 10-year-old! But so far have not been able to figure out how to calculate the unknowns using the knowns.

If anyone is lucky enough to not be a complete math-idiot I’d really appreciate any advice/explanation!

Thank you

Just use IK package for unity from the package manager! It's free!

I've seen some of these on the store, but I'm really keen to make my own if I can. Have always hidden from math when I should have used it and I don't want that dread anymore so it's time I practice!

Thanks anyway though!

Well, I have no idea, so good luck!

p.s you might want to look into the code used in the IK package to get your answer..

### Your answer

### Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.

### Follow this Question

### Related Questions

Fixed distance between objects? 2 Answers

2D character face another character 2 Answers

Find point of top of rotated sprite 1 Answer

Problems with foot placement (IK) 0 Answers

Humanoid IK question. 1 Answer