Std.Math
This page is still under construction!
This feature is still not implemented!
namespace Std.Math
Std.Math
conteins a diversity of mathematical functions and structures
Structures
Structure | Description |
---|---|
Vec2 | A vector of 2 dimensions represented by f32 |
Vec3 | A vector of 3 dimensions represented by f32 |
Vec4 | A vector of 4 dimensions represented by f32 |
Fields
@public const f64 PI
stores f64:
@public const f64 E
stores f64:
Functions
@public func T sin(type T, T rad)
Returns the sine value for the provided angle in radians.
type T:
T rad:
returns T:
rad
.@public func T cos(type T, T rad)
Returns the cossine value for the provided angle in radians.
type T:
T rad:
returns T:
rad
.@public func T tan(type T, T rad)
Returns the tangent value for the provided angle in radians.
type T:
T rad:
returns T:
rad
.@public func T atan(type T, T x)
Returns the arc-tangent of x
.
type T:
T x:
returns T:
x
.@public func T atan2(type T, T x, T y)
Returns the arc-tangent of the x/y
value.
Is more secure than atan
as it provides
the zero check of y
.
type T:
T x:
T y:
returns T:
x / y
.@public func T sqrt(type T, T val)
Returns the square root of the providade value.
type T:
T val:
returns T:
val
.@public func T abs(type T, T val)
Returns the absolute value of a signed number, without the sign.
type T:
T val:
returns T:
val
.@public func T ceil(type T, T val)
Returns the smallest integral value greater or equal than val
.
type T:
T val:
returns T:
val
.@public func T floor(type T, T val)
Returns the smallest integral value lesser or equal than val
.
type T:
T val:
returns T:
val
.@public func T truncate(type T, T val)
Returns the provided value rounded towards zero.
type T:
T val:
returns T:
@public func T round(type T, T val)
Returns the provided value rounded to the nearest integer.
type T:
T val:
returns T:
@public func T deg2rad(type T, T deg)
Converts the provided degress angle to radians.
type T:
T val:
returns T:
@public func T rad2deg(type T, T rad)
Converts the provided radians angle to degress.
type T:
T val:
returns T:
@public func T log(type T, T val, T base)
Returns the logarithm of the provided value in the providade base.
type T:
T val:
T base:
returns T:
val
in base base
.