What's wrong with this algorithm?

Hello,

I want to find the degrees of a corner C by using the “cosine rule” when I print the returned number, it gives me “Nan”

What’s wrong?

var Cdegree = Mathf.Acos( (Mathf.Sqrt(a) + Mathf.Sqrt(b) - Mathf.Sqrt(c)) / 2 * a * b);
print (Mathf.Rad2Deg * Cdegree);

//a,b,c are the 3 lines of the triangle

/ ( 2 * a * b ) );

And the cosine rule gives Cos^-1( (a^2 + b^2 - c^2) / (2ab) ) Maths, not code

You take the square root of each lenght which doesn’t make any sense… You should square them instead.

Mathf.Acos( (a*a + b*b - c*c) / (2 * a * b) )