I’m confused. I looked at the documentation for Mathf.Cos and it says, “Returns the cosine of angle f in radians.” Does the result of sin, cos, tan etc have a unit? I thought cos returned a value with no unit.
I’m using Mathf.Cos in a script and getting unexpected results (because I don’t really know what I’m doing) and I think it has something to do with radians or degrees. The documentation added to my confusion.
The sine and cosine are ratios of two lengths, so they don’t have any units. Different versions of the functions accept radians or degrees (and in fact a calculator generally allows you to choose), but the result is the same for the same angle. Can you give any more detail about the problems you are having with Mathf.Cos?
After playing with a calculator and comparing to unity it cleared up for me. I was calculating Xvelocity and Yvelocity from a launch angle and initial velocity. To check my work and find theta again, I took arctan(Yv/Xv) and the result was in radians and I had to convert to degrees. I understand now. Unity is like a calculator in Radian mode.
Thanks again Andeeee for your help!