$PI in @variable...

   11834   2   1
User Avatar
Member
280 posts
Joined: Dec. 2015
Offline
I know insanely OCD but it really hurts to see the code like this:
@P.y +=sin(@P.x*$PI/2);
It works but is there an equivalent for PI with the new @ mark?

Nico.
https://www.imdb.com/name/nm8408875/ [www.imdb.com]
User Avatar
Member
166 posts
Joined: March 2013
Offline
You can access it as a vex variable if you do:
#include <math.h>
@test = PI;
@test2 = PI_2;
@test3 = PI_4;

So in your example you could replace $PI/2 with PI_2, if you include math.h at the top.
User Avatar
Member
280 posts
Joined: Dec. 2015
Offline
Thanks.
https://www.imdb.com/name/nm8408875/ [www.imdb.com]
  • Quick Links