It's not working well :-(
there is a bug with $cos and $sin, because $cos(270).deg should be 0 and $sin(180).deg, too.
Code:
$sin(180).deg

return 0.000001 (for example)