Can any one tell me what calculation you have to make to calculate scalene triangles angles if you know all the lengths of the sides?

i am trying to make ik system that will suit my needs and i need to calculate the angles at which my bones should be but i need some angles. i looked on internet but i have no idea how to do all of that in script.

fafase
March 27, 2013, 2:50pm
2
You have not search real well have you

The law of cosines is your answer.

Check there for instance.

Math explained in easy language, plus puzzles, games, quizzes, worksheets and a forum. For K-12 kids, teachers and parents.

Note that this is more of a math question than a unity question.

```
float AngleOfTriangle(float a, float b, float c){
float cAng = (a*a+b*b- c*c)/(2*a*b);
float rad = Mathf.Acos(cAng);
return Mathf.Rad2Deg(rad);
}
```

In this case, the c angle represents the angle opposite to the last edge provided as parameter.

EDIT: I realized I made one mistake, it was given as a^a+b^b-c^c but it is aa+b b-c*c those are squared not power of itself.
As requested in Js:

```
function AngleOfTriangle:float(a:float , b:float, c:float){
var cAng:float = (a*a+b*b- c*c)/(2*a*b);
var rad:float = Mathf.Acos(cAng);
return Mathf.Rad2Deg(rad);
}
```

And it is “Can you PLEASE write this in Javascript?”

thanks a lot!!!
i was stuck on this for 5 hours

function AngleOfTriangle (a:float , b:float, c:float): float{
var cAng:float = (aa+b b-cc)/(2 ab);
var rad:float = Mathf.Acos(cAng);
return Mathf.Rad2Deg rad;
}