Vex V5 Programming Trig Functions

I cannot seem to find anywhere how to do Trig functions such as sin, cos, tan, arcsin, arccos, and arctan in Vex Coding Studio. We are using Vex C++. It would be a plus if there was a function to convert it to degrees too. I know in robotc you could use things such as asin, acos, and atan but I can’t get any of that to work anymore. Any help is much appreciated.

1 Like

You can look here: http://www.cplusplus.com/reference/cmath/

I believe VEX C++ automatically includes math.h, but I’m not sure what else it might automatically include. You can always include more yourself.

Thank you for the help, I thought I had already tried it but it appeared to be another error somewhere.

I just tested it in VEXcode, which has the same language as VCS, and the correct terms are:

sin();
cos();
tan();
asin();
acos();
atan();

1 Like

#include
std::sin();
std::cos();
std::tan();
std::asin();
std::acos();
std::atan();

ex)
for finding dX youd do like
float dX = std::cos(robotAngle) * distanceDriven;

also inclues fun stuff like std::abs(); and more that are very helpful