Difference between revisions of "Mathematical Functions in VEX"
From kunz
Views
Actions
Namespaces
Variants
Tools
Line 8: | Line 8: | ||
<syntaxhighlight lang='C++'> | <syntaxhighlight lang='C++'> | ||
y = pow(x,2); // Quadratic, same as: y = x*x; | y = pow(x,2); // Quadratic, same as: y = x*x; | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='C++'> | <syntaxhighlight lang='C++'> | ||
y = pow(2,x); // Exponential | y = pow(2,x); // Exponential, these functions grow very rapidly | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='C++'> | <syntaxhighlight lang='C++'> | ||
y = 1.0 / | y = 1.0 / x; // Reciprocal, with x in the denominator this will produce asymptotes at the axis | ||
</syntaxhighlight> | </syntaxhighlight> | ||
<syntaxhighlight lang='C++'> | <syntaxhighlight lang='C++'> | ||
y = pow(x,0.5); // Square Root, same as: y = sqrt(x); | y = pow(x,0.5); // Square Root, same as: y = sqrt(x); | ||
</syntaxhighlight> | |||
<syntaxhighlight lang='C++'> | |||
y = log(x); // Logarithmic | |||
</syntaxhighlight> | </syntaxhighlight> |
Revision as of 22:03, 29 September 2021
y = 0; // Constant (value remains the same over time)
y = x; // Linear
y = pow(x,2); // Quadratic, same as: y = x*x;
y = pow(2,x); // Exponential, these functions grow very rapidly
y = 1.0 / x; // Reciprocal, with x in the denominator this will produce asymptotes at the axis
y = pow(x,0.5); // Square Root, same as: y = sqrt(x);
y = log(x); // Logarithmic