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

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

25

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,476982,98449,817406,1293715,209568,526780,928263,1263961,2177557,3,2517345

Start Planet Minecraft!

We're a community of block friendly creatives sharing everything Minecraft! Even if you don't post your own creations, we appreciate feedback on ours. Join us!

Roll Random Mod!

- JJBA Stands DataPack II
*playlist_add*12 diamonds

4,917 views

357 downloads

7 comments

9 favorited**Game Version:**Minecraft 1.13*photo*x 9Mod - FMA Alchemy DataPack
*playlist_add*21 diamonds

14,344 views

1,758 downloads

28 comments

24 favorited**Game Version:**Minecraft 1.13*videocam**photo*x 5Mod - Enchanted Book Extractor DataPack (1.14)
**Game Version:**Minecraft 1.13*videocam**photo*x 3Mod - Custom NBT Crafting Utility & NEW Crafting Chest
*playlist_add*7 diamonds

4,234 views

0 downloads

4 comments

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

2,533 views

524 downloads

0 comments

1 favorited**Game Version:**Minecraft 1.13*photo*x 4Mod

5,752 | People Online |

2,385,834 | Total Members |

1,985,768 | Minecraft Submissions |

1,907,519,896 | Total Submission Views |

357,419,612 | Downloads |

- Super Mario Galaxy Maker [Datapack 1.13.1/1.13.2]
*playlist_add*7 diamonds

1,184 views

226 downloads

14 comments

5 favorited**Game Version:**Minecraft 1.13*videocam**photo*x 10Mod - Mods needed for Co'Co series
*playlist_add*0 diamonds

57 views

6 downloads

0 comments

0 favoritedPosted 11/11/2018

by AustinHammond2197**Game Version:**Minecraft 1.12.2*photo*x 1Mod - VoxelMap 1.13
*playlist_add*2,857 diamonds

3,811,039 views

2,065,837 downloads

4,528 comments

1,212 favorited**Game Version:**Minecraft 1.13*photo*x 10Mod - Xaero's Minimap [1.12/1.11/1.10/1.9/1.8/1.7][Forge]
*playlist_add*427 diamonds

2,404,532 views

877,170 downloads

1,098 comments

390 favorited**Game Version:**Minecraft 1.12.2*photo*x 1Mod - [1.12] Lucky Block - Drops items, spawns mobs, structures and more!
*playlist_add*678 diamonds

1,952,016 views

928,187 downloads

713 comments

318 favorited**Game Version:**Minecraft 1.12*photo*x 7Mod

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