Note

HELP WANTED!

Most class reference pages are not fully covered yet! If you have more information, please consider Contributing!

FixedMath

Overview

Methods Index

fixed

abs(n: fixed)

fixed

add(a: fixed, b: fixed)

fixed

angle_dist(a: fixed, b: fixed)

Dictionary

angle_to_vec(radians: fixed)

int

ceil(n: fixed)

fixed

deg2rad(degrees: fixed)

fixed

div(a: fixed, b: fixed)

bool

eq(a: fixed, b: fixed)

int

floor(n: fixed)

bool

ge(a: fixed, b: fixed)

bool

gt(a: fixed, b: fixed)

bool

le(a: fixed, b: fixed)

fixed

lerp_angle(a: fixed, b: fixed, ratio: fixed)

fixed

lerp_string(a: fixed, b: fixed, ratio: fixed)

bool

lt(a: fixed, b: fixed)

fixed

mul(a: fixed, b: fixed)

Dictionary

normalized_vec(x: fixed, y: fixed)

Dictionary

normalized_vec_times(x: fixed, y: fixed, length: fixed)

fixed

powu(n: fixed, p: int)

Dictionary

rotate_vec(x: fixed, y: fixed, radians: fixed)

int

round(n: fixed)

int

sign(n: fixed)

fixed

sub(a: fixed, b: fixed)

Dictionary

vec_add(x1: fixed, y1: fixed, x2: fixed, y2: fixed)

fixed

vec_dist(x1: fixed, y1: fixed, x2: fixed, y2: fixed)

Dictionary

vec_div(x: fixed, y: fixed, div: fixed)

fixed

vec_len(x: fixed, y: fixed)

fixed

vec_len_squared(x: fixed, y: fixed)

Dictionary

vec_mul(x: fixed, y: fixed, mul: fixed)

Dictionary

vec_round(x: fixed, y: fixed)

Dictionary

vec_sub(x1: fixed, y1: fixed, x2: fixed, y2: fixed)

fixed

vec_to_angle(x: fixed, y: fixed)


Method Descriptions

fixed abs(n: fixed) 🔗

Returns a fixed number string of the unsigned value of n


fixed add(a: fixed, b: fixed) 🔗

Returns a fixed number string of a + b


fixed angle_dist(a: fixed, b: fixed) 🔗

Returns a fixed number string of the difference between two angles.


Dictionary angle_to_vec(radians: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed }, representing the normalized vector pointing towards the specified angle


int ceil(n: fixed) 🔗

Returns n rounded up to the nearest integer number.


fixed deg2rad(degrees: fixed) 🔗

Returns a fixed number string rounded down to the nearest integer number.


fixed div(a: fixed, b: fixed) 🔗

Returns a fixed number string of a / b


bool eq(a: fixed, b: fixed) 🔗

Returns true if a is equal to b, otherwise returns false


int floor(n: fixed) 🔗

Returns n rounded down to the nearest integer number.


bool ge(a: fixed, b: fixed) 🔗

Returns a fixed number string of a - b


bool gt(a: fixed, b: fixed) 🔗

Returns true if a greater than b, otherwise returns false.


bool le(a: fixed, b: fixed) 🔗

Returns true if a less than or equal to b, otherwise returns false


fixed lerp_angle(a: fixed, b: fixed, ratio: fixed) 🔗

Returns a fixed number string of some angle between the angle a and angle b, where a is returned if ratio is “0.0”, b is returned if ratio is “1.0”, and the halfway point in between is returned if ratio is “0.5”


fixed lerp_string(a: fixed, b: fixed, ratio: fixed) 🔗

Returns a fixed number string of some value between a and b, where a is returned if ratio is “0.0”, b is returned if ratio is “1.0”, and the halfway point in between is returned if ratio is “0.5”


bool lt(a: fixed, b: fixed) 🔗

Returns true if a less than b, otherwise returns false.


fixed mul(a: fixed, b: fixed) 🔗

Returns a fixed number string of a * b


Dictionary normalized_vec(x: fixed, y: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of the specified 2D vector normalized (i.e. converted to a distance of 1 from {x:"0", y:"0"} towards the same angle)


Dictionary normalized_vec_times(x: fixed, y: fixed, length: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of the specified 2D vector converted to a distance of length from {x:"0", y:"0"} towards the same angle


fixed powu(n: fixed, p: int) 🔗

Returns a fixed number string of n to the power of p.

p must be a positive integer.


Dictionary rotate_vec(x: fixed, y: fixed, radians: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of the vector rotated by radians.


int round(n: fixed) 🔗

Returns n rounded to the nearest integer number.


int sign(n: fixed) 🔗

Returns -1 if n is negative, +1 if n is positive, and 0 if n is 0


fixed sub(a: fixed, b: fixed) 🔗

Returns a fixed number string of a - b


Dictionary vec_add(x1: fixed, y1: fixed, x2: fixed, y2: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of the sum of two 2D vectors.


fixed vec_dist(x1: fixed, y1: fixed, x2: fixed, y2: fixed) 🔗

Returns a fixed number string of the distance between two specified 2D vectors


Dictionary vec_div(x: fixed, y: fixed, div: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of a 2D Vector divided by div


fixed vec_len(x: fixed, y: fixed) 🔗

Returns a fixed number string of the distance between the specified 2D vector and {x:"0", y:"0"}


fixed vec_len_squared(x: fixed, y: fixed) 🔗

Returns a fixed number string of x*x + y*y, effectively the length of the vector squared. Useful for more efficiently comparing distances if the exact length is not needed, as this function will skip the square root calculation needed for vector length.


Dictionary vec_mul(x: fixed, y: fixed, mul: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of a 2D Vector multiplied by mul


Dictionary vec_round(x: fixed, y: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of a 2D Vector divided by div


Dictionary vec_sub(x1: fixed, y1: fixed, x2: fixed, y2: fixed) 🔗

Returns a ^Dictionary { ‘x’ : ^fixed , ‘y’ : ^fixed } of {x1, y1} - {x2, y2}


fixed vec_to_angle(x: fixed, y: fixed) 🔗

Returns a fixed number string of the angle pointing towards a specified 2D vector