Published on Jul 7, 7/7/18 11:07 am

- 6
- 3
*playlist_add**share*-
*more_horiz*

19

Includes sine, cosine, tangent, absolute value, exponent, square root, and random

This was designed to be like the Math import in Java or Python, but for datapacks

Feel free to use this with your datapacks; if you use it credit would be appreciated

To use the functions, set the "math_in" and other input variables, call the function, and then get the "math_out" variable

function math:sin

"math_in" is an angle in degrees; "math_out" will be the sine of the angle scaled up by 100

function math:cos

"math_in" is an angle in degrees; "math_out" will be the cosine of the angle scaled up by 100

function math:tan

"math_in" is an angle in degrees; "math_out" will be the tangent of the angle scaled up by 100

function math:abs

"math_in" is a number; "math_out" will be the absolute value of the number

function math:pow

"math_in" is a base; "math_exp" is an exponent; "math_out" will be the base to the power of the exponent

function math:sqrt

"math_in" is a number; "math_out" will be the absolute value of the number scaled up by 100

function math:rand (Contributed by Mcskware using using the random0 LCG)

"math_maxrand" is a maximum value; "math_out" will be a psuedo-random number from 0 to the maximum value, inclusive

because scoreboard variables have to be integers, all input and output values are integers

sin, cos, tan, and sqrt output values are scaled up by 100 to allow 2 extra decimal places of precision

sin, cos, and tan are approximations, and have an average error of about 0.04 (so an average error of about 4 for the scaled up value)

input values are preserved by all functions

Thanks to Mcskware for contributing the PRNG!

Credit | Mcskware for the PRNG |

Progress | 100% complete |

Game Version | Minecraft 1.13 |

Tags |

tracking

4153687

mathematical-functions-datapack

1,165079,329,3672,559826,842002,140820,64651,214207,712893,625964,356071,290694,895971,1030646,15493,171513,336698,476982,98449,817406,1293715,209568,526780,928263,1263961,2177557,3,2517345

Roll Random Mod!

- JJBA Stands DataPack II
*playlist_add*9 diamonds

2,995 views

156 downloads

4 comments

5 favorited**Game Version:**Minecraft 1.13*photo*x 8Mod - Custom NBT Crafting Utility & NEW Crafting Chest
*playlist_add*5 diamonds

3,466 views

0 downloads

0 comments

2 favorited**Game Version:**Minecraft 1.13*photo*x 4Mod - OP Igloos, Ultimate Toggleable Bows, and Tsunamis Datapack
*playlist_add*2 diamonds

1,961 views

403 downloads

0 comments

1 favorited**Game Version:**Minecraft 1.13*photo*x 4Mod - FMA Alchemy DataPack
*playlist_add*18 diamonds

10,769 views

1,300 downloads

9 comments

19 favorited**Game Version:**Minecraft 1.13*videocam**photo*x 5Mod - Dragon Effect Armor Datapack
*playlist_add*3 diamonds

1,389 views

180 downloads

0 comments

1 favoritedPosted 08/06/2018

by yosho27**Game Version:**Minecraft 1.13*photo*x 1Mod

4,970 | People Online |

2,372,565 | Total Members |

1,974,190 | Minecraft Submissions |

1,886,975,958 | Total Submission Views |

354,726,237 | Downloads |

- Back to the Future Mod
*playlist_add*13 diamonds

4,122 views

1,147 downloads

14 comments

10 favoritedPosted 09/24/2018

by ThinkPP13**Game Version:**Minecraft 1.12.2*photo*x 3Mod - Spider Leftovers [Data Pack]
**Game Version:**Minecraft 1.13*photo*x 1Mod - Worldedit 1.13 - Create Lines and Vector Graphics in MInecraft | Datapack
*playlist_add*3 diamonds

425 views

48 downloads

0 comments

2 favoritedPosted 09/20/2018

by Stevertus**Game Version:**Minecraft 1.13*videocam**photo*x 1Mod - Worldedit 1.13 Brushes for Minecraft Vanilla | Datapack
*playlist_add*1 diamonds

258 views

25 downloads

0 comments

0 favoritedPosted 09/20/2018

by Stevertus**Game Version:**Minecraft 1.13*videocam**photo*x 1Mod - Spider Webbing [Data Pack]
**Game Version:**Minecraft 1.13*photo*x 1Mod

https://www.planetminecraft.com/css/style-v-version557.css,https://www.planetminecraft.com/css/editor-v-version557.css