My problem is this: I try and run the script in Blender's text editor and the script fails to math functions, cos() does not work.
When I run the same code in Blender's Python console my pasting it directly, there is no problem
What is the reason / how to get it work from the Text Editor?
math.cos(angle)
or to use directly,from math import cos
. For convenience sake the math and mathutils methods have been imported for you in the console.from math import *
(See banner message). $\endgroup$