Math Trigonometric Functions
The scope of applications for UnigineScript is limited to implementing materials-related logic (material expressions, scriptable materials, brush materials). Do not use UnigineScript as a language for application logic, please consider C#/C++ instead, as these APIs are the preferred ones. Availability of new Engine features in UnigineScript (beyond its scope of applications) is not guaranteed, as the current level of support assumes only fixing critical issues.
Math Class
Members
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
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:
2021-12-13
Help improve this article
Was this article helpful?
(or select a word/phrase and press Ctrl+Enter)