In order to use trigonometric functions in command file (py files), you have to specify or to load the library that contains these functions. For that, there are two possibilities:
Solution 1
In the python file, add the line: from math import * This line allows using directly the function cos, sin, cosd, sind…
Solution 2
In the python file, add the line: import math This line allows the math module download. Then, in order to use the functions, you have to type math.cos(), math.sin(), math.cosd(),math.sind()…