Ceci est une ancienne révision du document !
int FloatToInt(float value, optional RoundDirection)Converts the supplied floating point value into an integer.
Display("Round down: %d", FloatToInt(10.7)); Display("Round up: %d", FloatToInt(10.7, eRoundUp)); Display("Round nearest: %d", FloatToInt(10.7, eRoundNearest));
displays the integer value of 10.7, rounded in the three different ways.
See Also: IntToFloat
float IntToFloat(int value)Converts the supplied integer value into a floating point number.
float number = IntToFloat(10);
loads 10.0 into the variable number .
See Also: FloatToInt
float Maths.ArcCos(float value)Calculates the arc-cosine, in radians, of the specified value.
float angle = Maths.ArcCos(1.0);
calculates the arc-cosine of 1.0 and places it into variable angle .
See Also: Maths.Cos,
Maths.DegreesToRadians,
float Maths.ArcSin(float value)Calculates the arc-sine, in radians, of the specified value.
float angle = Maths.ArcSin(0.5);
calculates the arc-sine of 0.5 and places it into variable angle .
See Also: Maths.Sin,
Maths.DegreesToRadians,
float Maths.ArcTan(float value)Calculates the arc-tan, in radians, of the specified value.
float angle = Maths.ArcTan(0.5);
calculates the arc-tan of 0.5 and places it into variable angle .
See Also: Maths.ArcTan2,
Maths.DegreesToRadians,
Maths.Tan
float Maths.ArcTan2(float y, float x)Calculates the arctangent of y/x. This is well defined for every point other than the origin, even if x equals 0 and y does not equal 0. The result is returned in radians.
float angle = Maths.ArcTan2(-862.42, 78.5149);
calculates the arc-tan of -862.42 / 78.5149 and places it into variable angle .
See Also: Maths.DegreesToRadians,
Maths.ArcTan
float Maths.Cos(float radians)Calculates the cosine of the specified angle (in radians).
float cosine = Maths.Cos(Maths.DegreesToRadians(360.0));
calculates the cosine of 360 degrees (which is 1.0) and places it into variable cosine .
See Also: Maths.ArcCos,
Maths.DegreesToRadians,
Maths.Sin, Maths.Tan
float Maths.DegreesToRadians(float degrees)Converts the supplied angle in degrees, to the equivalent angle in radians.
float cosine = Maths.Cos(Maths.DegreesToRadians(360.0));
calculates the cosine of 360 degrees (which is 1.0) and places it into variable cosine .
See Also: Maths.Cos,
Maths.RadiansToDegrees,
Maths.Sin, Maths.Tan
float Maths.RadiansToDegrees(float radians)Converts the supplied angle in radians, to the equivalent angle in degrees.
float halfCircle = Maths.RadiansToDegrees(Maths.Pi);
converts PI radians into degrees (which is 180).
See Also: Maths.Cos,
Maths.DegreesToRadians,
Maths.Sin, Maths.Tan
float Maths.RaiseToPower(float base, float exponent)Calculates the value of base raised to the power exponent .
float value = Maths.RaiseToPower(4.0, 3.0);
calculates 4 to the power 3 (which is 64).
See Also: Maths.Sqrt
float Maths.Sin(float radians)Calculates the sine of the specified angle (in radians).
float sine = Maths.Sin(Maths.DegreesToRadians(360.0));
calculates the cosine of 360 degrees (which is 0) and places it into variable sine .
See Also: Maths.ArcSin,
Maths.DegreesToRadians,
Maths.Cos, Maths.Tan
float Maths.Sqrt(float value)Calculates the square root of the supplied value.
Display("The square root of 4 is %d!", FloatToInt(Maths.Sqrt(4.0)));
displays the square root of 4 (rounded down to the nearest integer).
See Also: Maths.Cos,
Maths.RaiseToPower,
Maths.Sin, Maths.Tan
float Maths.Tan(float radians)Calculates the tangent of the specified angle (in radians).
float tan = Maths.Tan(Maths.DegreesToRadians(45.0));
calculates the tan of 45 degrees (which is 1.0) and places it into variable tan .
See Also: Maths.ArcTan,
Maths.DegreesToRadians,
Maths.Cos, Maths.Sin,