Is there a way to use Pi in a formula? There doesn't seem to be anything under System/Math and entering wacky python things like math.pi doesn't work either. I'm looking for as precise a value as possible since typing 3.14etc causes misalignments fast.
Develop games in your browser. Powerful, performant & highly capable.
You can initialize a script which contains the following at the start of the layout:
And then you can use Python("math.pi") to retrieve the value of pi. It also works in equations like Python("math.pi") /2 so it should work for whatever you want it to.
Since pi value is constant, it would be easier to just define a global variable, call it pi and set its value to 3.1415926535897931, Python's pi value.
Why not go a step further:
Or you could remember it up to three or four decimals (3.1416) and reuse that, which should suffice for many calculations.
Hope that helps!