Note
HELP WANTED!
Most class reference pages are not fully covered yet! If you have more information, please consider Contributing!
FixedMath
Overview
Methods Index
angle_dist(a: fixed, b: fixed) |
|
angle_to_vec(radians: fixed) |
|
lerp_angle(a: fixed, b: fixed, ratio: fixed) |
|
lerp_string(a: fixed, b: fixed, ratio: fixed) |
|
normalized_vec(x: fixed, y: fixed) |
|
normalized_vec_times(x: fixed, y: fixed, length: fixed) |
|
rotate_vec(x: fixed, y: fixed, radians: fixed) |
|
vec_len_squared(x: fixed, y: fixed) |
|
vec_to_angle(x: fixed, y: fixed) |
Method Descriptions
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
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
Returns true if a is equal to b, otherwise returns false
Returns n rounded down to the nearest integer number.
Returns a fixed number string of a - b
Returns true if a greater than b, otherwise returns false.
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”
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.
Returns n rounded to the nearest integer number.
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