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 PIstores f64:
@public const f64 Estores f64:
Functions
@public func sin(type T, T rad) TReturns the sine value for the provided angle in radians.
type T:
T rad:
returns T:
rad.@public func cos(type T, T rad) TReturns the cossine value for the provided angle in radians.
type T:
T rad:
returns T:
rad.@public func tan(type T, T rad) TReturns the tangent value for the provided angle in radians.
type T:
T rad:
returns T:
rad.@public func atan(type T, T x) TReturns the arc-tangent of x.
type T:
T x:
returns T:
x.@public func atan2(type T, T x, T y) TReturns 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 sqrt(type T, T val) TReturns the square root of the providade value.
type T:
T val:
returns T:
val.@public func abs(type T, T val) TReturns the absolute value of a signed number, without the sign.
type T:
T val:
returns T:
val.@public func ceil(type T, T val) TReturns the smallest integral value greater or equal than val.
type T:
T val:
returns T:
val.@public func floor(type T, T val) TReturns the smallest integral value lesser or equal than val.
type T:
T val:
returns T:
val.@public func truncate(type T, T val) TReturns the provided value rounded towards zero.
type T:
T val:
returns T:
@public func round(type T, T val) TReturns the provided value rounded to the nearest integer.
type T:
T val:
returns T:
@public func deg2rad(type T, T deg) TConverts the provided degress angle to radians.
type T:
T val:
returns T:
@public func rad2deg(type T, T rad) TConverts the provided radians angle to degress.
type T:
T val:
returns T:
@public func log(type T, T val, T base) TReturns the logarithm of the provided value in the providade base.
type T:
T val:
T base:
returns T:
val in base base.Enums
@public typedef Operation {
case SafeAdd
case AddWithOverflow
case AddOnBounds
case SafeSubtract
case SubtractWithOverflow
case SubtractOnBounds
case SafeMultiply
case MultiplyWithOverflow
case MultiplyOnBounds
case Divide
case DivideFloor
case DivideCeilling
}