- Home /
The question is answered, right answer was accepted
Rad to degree
Hello!
Why is this line wrong???
float deg = Mathf.Tan(30) * Mathf.Rad2Deg;
The return = -2.18504, that is not what I want.
I know that rad have to get to grad, but however...
What I want to do is, making this simple calculation:
tan30 = 0.57735....
weired...
Please help. Thanks!
Trig methods expect rad values, I doubt 30 is. So u probably want to convert 30 to radians and then pass it to tan.
Answer by black843 · Jun 21, 2015 at 06:05 PM
I found it out!
It has to be following:
float deg = (Mathf.Tan(30 * Mathf.Deg2Rad) );
I firstly had to calculate my numbers back to Input type radans and the I can return to grads.
Question stays to help others ;) Cheers
Follow this Question
Related Questions
Distance before shooting issue. 1 Answer
Calculate a new position instead of using Vector3.back 1 Answer
Compute Shader for Calculations? (like, find closet thing ???) 1 Answer
[Resolved] Why unity print 0.08f + 0.02f as 0.0999999 instead of 0.1? 1 Answer
Raycast distance change object color 3 Answers