The reason is that in standard C, sin and cos are using radians. But var variables are using degrees.