# Scripted expressions editor gives unexpected results

Does anyone know why when I type in driver editor / scripted expression I get funny values? This is my examle:

I drive spotlight angle with an cubes translate Z value witch is limited to value between 5 and 8(limit location constraint).

So when I leave "var" alone (which is 5 value) the result is 180° instead of 5?

Does anyone knwo why and how to remap the range from 5-8 to be 1-180?

• The expression to 180 would be (var-5) (shift the 0 point) *(pi/180) (convert to radians) *60 (map the range of 3 to a range of 180). This simplifiies to (var-5) * (pi/3). Slightly clobbered by the min spotlight angle being 1 degree, not 0. (You can accept your own answer) – Robin Betts Jul 24 at 11:15
• Also worth noting Nothing is "auto converted to degrees" . Radians is the default rotation unit. For all Rotation property values. Degrees is however the default unit chosen to display rotation in the UI (in the properties scene units panel) An alternative way to convert to radians is radians(x) – batFINGER Jul 24 at 11:35