Compatibility
Minecraft: Java Edition
Platforms
Creators
Details
Changelog
Fixed Point = Int fixed point with 3 decimal after the coma(1->1000, 2.107->2107, 3.1415->3141)
Vector = Array of 3 double var
Setup
/function math:setup
To initialize the pack you need to execute this command
Math Functions
Fixed Point exponential Approximation
/function math:function/exp
Input : scoreboard "In0 RacoonMath" Number Fixed Point, max input value : 46238(= 46.238), min input value : -6907(= -6.907)
Output: this function return the value of the fixed point exponential
Integer Fast exponentiation Approximation
/function math:function/fast_exponentiation
Input : scoreboard "In0 RacoonMath" and "In1 RacoonMath", In0 = base, In1 = power
Output: this function return the value of the base raised to the power
Square Root Approximation
/function math:function/sqrt
Input : scoreboard "In0 RacoonMath" Integer
Output: this function return the square root of the Input
(If you are interested by how it work see heron's method square root approximation)
Fixed Point natural log Approximation
/function math:function/log
Input : scoreboard "In0 RacoonMath" Fixed Point
Output: this function return the fixed point value of the natural log of the Input
(It's an approximation of the integral of 1/x that give us an approximation of natural log)
Trigonometry
Sin Approximation
/function math:trigo/sin
Input : Yaw of rotation of the execution (angle in degrees)
Output: return the fixed point sin value of the input
Cos Approximation
/function math:trigo/cos
Same that sin but return the cos value
Tan Approximation
/function math:trigo/tan
Same that sin and cos but return the tan value
Fast Sin Approximation
/function math:trigo/fast_sin
A less accurate but more optimized approximation of sin
Input : scoreboard "In0 RacoonMath" Fixed Point (angle in Radians)
Output: return the fixed point sin value of the input
Fast Cos Approximation
/function math:trigo/fast_cos
same that fast sin but for cos
Vectors
Unit Vector
/function math:vector/unit_vector
return a 3d vector with angles of the current rotation and length = 1, very accurate
Input : Rotation of the execution (angle in degrees)
Output: storage math:data out (vector)
Unit Vector Input
/function math:vector/unit_vector_input
return a 3d vector with angles of the inputs and length = 1, less accurate
Input : scoreboards "In0 RacoonMath" and "In1 RacoonMath" (angle in radians)
Output: storage math:data out (vector)
Add
/function math:vector/add
return the sum of the two vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (array of 2 vectors)
Output: storage math:data out (vector)
Subtract
/function math:vector/subtract
return the subtraction of the two vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (array of 2 vectors)
Output: storage math:data out (vector)
Opposite
/function math:vector/neg
return the opposite vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (vector)
Output: storage math:data out (vector)
Multiplication by a fixed point
/function math:vector/mult
return the vector multiplied by a fixed point with an accuracy of 3 digits after the coma
Input : storage "math:data in" (vector) and scoreboard "In0 RacoonMath" (fixed point)
Output: storage math:data out (vector)
Normalize
/function math:vector/normalize
return the normalized vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (vector)
Output: storage math:data out (vector)
Cross product
/function math:vector/cross_product
return the cross product of the two vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (array of 2 vectors)
Output: storage math:data out (vector)
Dot product
/function math:vector/dot_product
return the dot product of the two vector with an accuracy of 3 digits after the coma
Input : storage "math:data in" (array of 2 vectors)
Output: return a fixed point
Sort
Radix
/function math:sort/radix
return a sorted int array
Input : storage "math:data in" (int array to sort), scoreboard "In0 RacoonMath" (number of digits take to sort)
Output: storage "math:data out"
Min
/function math:sort/min
return the minimum of an int array
Input : storage "math:data in" (int array)
Output: return an int
Max
/function math:sort/max
return the maximum of an int array
Input : storage "math:data in" (int array)
Output: return an int
Min Max
/function math:sort/min_max
return the minimum and maximum of an int array
Input : storage "math:data in" (int array)
Output: scoreboard "Out0 RacoonMath" (minimum), scoreboard "Out1 RacoonMath" (maximum)
Converter
Tick to hhmmss
/function math:convert/tick_to_hhmmss
convert a tick duration in hours min and sec strings
Input : scoreboard "In0 RacoonMath"
Output: storage "math:data out.hour","math:data out.min","math:data out.sec"
Tick to mmss
/function math:convert/tick_to_mmss
convert a tick duration in min and sec strings
Input : scoreboard "In0 RacoonMath"
Output: storage "math:data out.min","math:data out.sec"
rgb to int
/function math:convert/rgb_to_int
convert rgb in an rgb int
Input : scoreboard "In0 RacoonMath" (Red),scoreboard "In1 RacoonMath" (Green),scoreboard "In2 RacoonMath" (Blue)
Output: return an int
rgba to int
/function math:convert/rgba_to_int
convert rgba in an rgb int
Input : scoreboard "In0 RacoonMath" (Red),scoreboard "In1 RacoonMath" (Green),scoreboard "In2 RacoonMath" (Blue),scoreboard "In3 RacoonMath" (Alpha)
Output: return an int
int to rgb
/function math:convert/int_to_rgb
convert an int in rgb values
Input : scoreboard "In0 RacoonMath"
Output: scoreboard "Out0 RacoonMath" (Red),scoreboard "Out1 RacoonMath" (Green),scoreboard "Out2 RacoonMath" (Blue)
int to rgba
/function math:convert/int_to_rgba
convert an int in rgba values
Input : scoreboard "In0 RacoonMath"
Output: scoreboard "Out0 RacoonMath" (Red),scoreboard "Out1 RacoonMath" (Green),scoreboard "Out2 RacoonMath" (Blue),scoreboard "Out3 RacoonMath" (Alpha)
int to hex
/function math:convert/int_to_hex
convert an int in hexadecimal strings array
Input : scoreboard "In0 RacoonMath"
Output: storage "math:data out"
Files
Metadata
Release channel
ReleaseVersion number
1.0.0Loaders
Game versions
1.21.6–1.21.8Downloads
5Publication date
August 6, 2025 at 12:54 PMPublisher

RacoonJohn
Member


