Header menu logo Nu

Math Module

Functions and values

Function or value Description

Math.DegreesToRadians degrees

Full Usage: Math.DegreesToRadians degrees

Parameters:
    degrees : single

Returns: float32

Convert degrees to radians.

degrees : single
Returns: float32

Math.DegreesToRadians3d degrees

Full Usage: Math.DegreesToRadians3d degrees

Parameters:
Returns: Vector3

Convert degrees to radians in 3d.

degrees : Vector3
Returns: Vector3

Math.Init ()

Full Usage: Math.Init ()

Parameters:
    () : unit

Initializes the type converters found in Math.fs.

() : unit

Math.RadiansToDegrees radians

Full Usage: Math.RadiansToDegrees radians

Parameters:
    radians : single

Returns: float32

Convert radians to degrees.

radians : single
Returns: float32

Math.RadiansToDegrees3d radians

Full Usage: Math.RadiansToDegrees3d radians

Parameters:
Returns: Vector3

Convert radians to degrees in 3d.

radians : Vector3
Returns: Vector3

Math.SnapDegree (offset, value)

Full Usage: Math.SnapDegree (offset, value)

Parameters:
    offset : single
    value : single

Returns: single

Snap a degree value to an offset. Has a minimum granularity of 1.0f.

offset : single
value : single
Returns: single

Math.SnapDegree3d (offset, v3)

Full Usage: Math.SnapDegree3d (offset, v3)

Parameters:
Returns: Vector3

Snap a degree value to an offset. Has a minimum granularity of 1.0f.

offset : single
v3 : Vector3
Returns: Vector3

Math.SnapF (offset, value)

Full Usage: Math.SnapF (offset, value)

Parameters:
    offset : single
    value : single

Returns: single

Snap a single value to an offset. Has a minimum granularity of 0.01f.

offset : single
value : single
Returns: single

Math.SnapF3d (offset, v3)

Full Usage: Math.SnapF3d (offset, v3)

Parameters:
Returns: Vector3

Snap a Vector3 value to an offset. Has a minimum granularity of 0.001f.

offset : single
v3 : Vector3
Returns: Vector3

Math.SnapI (offset, value)

Full Usage: Math.SnapI (offset, value)

Parameters:
    offset : int
    value : int

Returns: int

Snap an int value to an offset.

offset : int
value : int
Returns: int

Math.TryUnionSegmentAndFrustum (start, stop, frustum)

Full Usage: Math.TryUnionSegmentAndFrustum (start, stop, frustum)

Parameters:
Returns: (Vector3 * Vector3) option

Find the union of a line segment and a frustum if one exists. NOTE: there is a bug in here (https://github.com/bryanedds/Nu/issues/570) that keeps this from being usable on long segments.

start : Vector3
stop : Vector3
frustum : Frustum
Returns: (Vector3 * Vector3) option

Math.TryUnionSegmentAndFrustum' (start, stop, frustum)

Full Usage: Math.TryUnionSegmentAndFrustum' (start, stop, frustum)

Parameters:
Returns: (Vector3 * Vector3) array

Find the the union of a line segment and a frustum if one exists. NOTE: this returns the union in parts in order to mostly workaround the bug in TryUnionSegmentAndFrustum.

start : Vector3
stop : Vector3
frustum : Frustum
Returns: (Vector3 * Vector3) array

Type something to start searching.