Functions that don't fit in any of the other categories.
floating zmlToDegrees(floating rad)rad the value, in radians, to convert to degrees.Takes a value rad, expressed in radians, and converts it to degrees.
floating zmlToRadians(floating deg)deg the value, in degrees, to convert to radians.Takes a value deg, expressed in degrees, and converts it to radians.
void zmlToStringV(zmlVector val, char *str)val the vector to format and express as a string.str the string to return the value into.
Takes a zmlVector val and converts it to a formatted string.
See this answer on StackOverflow for an explanation into
returning the string as an argument, rather than a return type. The string is formatted as such:
(vec2) ( 3.00000, 3.00000 )There are always 5 decimals of precision. This is not representative of the internal precision of the value. To print vector elements with higher precision, you will need to do it manually e.g.
printf("%.9f", vec.elements[0]).
void zmlToStringM(zmlMatrix val, char *str)val the matrix to format and express as a string.str the string to return the value into.
Takes a zmlMatrix val and converts it to a formatted string.
See this answer on StackOverflow for an explanation into
returning the string as an argument, rather than a return type. The string is formatted as such:
(mat2x2) [ 3.00000, 0.00000 ],
[ 0.00000, 3.00000 ]
There are always 5 decimals of precision. This is not representative of the internal precision of the value.
To print matrix elements with higher precision, you will need to do it manually e.g. printf("%.9f", mat.elements[0][0]).
void zmlPrintV(zmlVector val)val the vector to format and print.Prints the output of zmlToStringV() to stdout (with a new line). The string allocated to print the vector is intended to be optimised so that it is the exactly correct length to use as little memory as possible, so you should use this function to print vectors rather than manually printing the output of zmlToStringV() (plus it's more convenient).
There are always 5 decimals of precision. This is not representative of the internal precision of the value. To print vector elements with higher precision, you will need to do it manually e.g.printf("%.9f", vec.elements[0]).
void zmlPrintM(zmlMatrix val)val the matrix to format and print.Prints the output of zmlToStringM() to stdout (with 2 new lines). The string allocated to print the matrix is intended to be optimised so that it is the exactly correct length to use as little memory as possible, so you should use this function to print matrice rather than manually printing the output of zmlToStringV() (plus it's more convenient).
There are always 5 decimals of precision. This is not representative of the internal precision of the value. To print matrix elements with higher precision, you will need to do it manually e.g.printf("%.9f", mat.elements[0][0]).
floating zmlLerp(floating val, floating start1, floating stop1,
floating start2, floating stop2)
val the value to interpolatestart1 the min point of the input rangestop1 the max point of the input rangestart2 the min point of the output rangestop2 the max point of the output range
Performs a linear interpolation operation on value val. The input range is specified with
start1 and stop1, and the output range is specified with start2
and stop2. The formula used by the function is as follows:
start2 + (stop2 - start2) * ((val - start1) / (stop1 - start1))
PIThe irrational mathematical constant of the same name. This is pi (π) shown to the nearest 21 decimal places, as stored internally in zetaml:
3.141592653589793238463