I\'ve tried
$x = cos(deg2rad($angle));
but it returns 6.12323399574E-17 when the angle is 90 degrees instead of 0. I read that this is a fl
Try this
$x = round(cos(deg2rad($angle)), 3);