Math Trigonometrical Functions
variable acos(variable arg)
Returns the arc cosine of the given argument - the angle in radians, whose cosine is equal to arg. a == cos(acos(a)) for every value of a that is within acos()'s range.Arguments
Return value
Arc cosine of arg, in radians. The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable asin(variable arg)
Returns the arc sine of the given argument - the angle in radians, whose sine is equal to arg. a == sin(asin(a)) for every value of a that is within asin()'s range.Arguments
Return value
Arc sine of arg, in radians. The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable atan(variable arg)
Returns the arc tangent of the given argument - the angle in radians, whose tangent is equal to arg. a == tan(atan(a)) for every value of a that is within atan()'s range.Arguments
Return value
Arc tangent of arg, in radians. The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable atan2(variable y, variable x)
Returns the arc tangent of two variables (x and y). It is similar to calculating the arc tangent of y / x, except that the signs of both arguments are used to determine the quadrant of the result.Arguments
- variable y - First argument. Can be the following types:
- variable x - Second argument.
Return value
Result in radians, which is between -PI and PI (inclusive). The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable cos(variable arg)
Returns the cosine of the given argument.Arguments
- variable arg - Argument, in radians. Can be the following types:
Return value
Cosine of arg. The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable sin(variable arg)
Returns the sine of the given argument.Arguments
- variable arg - Argument, in radians. Can be the following types:
Return value
Sine of arg. The type of returned value will depend on the argument type:- float for int, long, float arguments
- double for double arguments
- vec4 for vec4 arguments
- dvec3 for dvec3 arguments
- dvec4 for dvec4 arguments
variable tan(variable arg)
Returns the tangent of the given argument.Arguments
- variable arg - Argument, in radians. Can be the following types:
Return value
Tangent of arg. The type of returned value will depend on the argument type:Last update: 2018-08-10
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)