🎉Community Raffle - Win $25

An exclusive raffle opportunity for active members like you! Complete your profile, answer questions and get your first accepted badge to enter the raffle.
Join and Win

How to use trigonometric functions in command files?

User: "Yann_Le_Floch"
Altair Employee
Updated by Yann_Le_Floch

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()…

Comments

No comments on this post.