Cosine function always returns 2

I am trying to use the cosine (and sine) functions and they are not working. When I debug with print(Math.Cos(transform.rotation.z * Mathf.Deg2Rad) * 2); Cosine always returns roughly 2, and sine always returns roughly 0, no matter what direction the object is facing. I have also tried using Mathf.Cos() as well and not converting to radians. Why is this happening?

This value has nothing to do with eulerAngles so don’t use it.

All about Euler angles and rotations, by StarManta:

https://starmanta.gitbooks.io/unitytipsredux/content/second-question.html

Quaternion dumper if you absolutely insist on peeking inside the ugly parts:

Fixed:

print(Math.Cos(transform.rotation.eulerAngles.z * Mathf.Deg2Rad) * 2);