CalculationService: An easier way to calculate


------------------------------------------------------------v.1.3.1-----------------------------------------------------------------
Link: Calculation Service

CalculationService; a brand new module script that allows calculation to be made easier! There are currently 111 unique functions and every function returns a value! Pass in the numbers the function requires and you will be given a value straight away!

If you don’t understand some words, I made some comments regarding what the words mean.

Functions
  1. CalculateArcAngle
  2. CalculateArcLength
  3. CalculateArcSurfaceArea
  4. CalculateAreaOfACircle
  5. CalculateAreaOfaSquare
  6. CalculateAreaOfaTriangle
  7. CalculateAreaTriangle
  8. CalculateAreaofACylinder
  9. CalculateAverage
  10. CalculateCathetusPythagoreanTheorem
  11. CalculateCircleRing
  12. CalculateCircumeferenceOfASquare
  13. CalculateCircumfrenceOfACircle
  14. CalculateConeSurfaceArea
  15. CalculateConeVolume
  16. CalculateCoreValue
  17. CalculateCosAngle
  18. CalculateCosMissingAdjacentCath
  19. CalculateCosMissingHypotenuse
  20. CalculateDistance
  21. CalculateFactorNinExponentialDecrease
  22. CalculateFactorNinExponentialIncrease
  23. CalculateHypotenusePythagoreanTheorem
  24. CalculateNewValue
  25. CalculatePercentage
  26. CalculatePyramidSurfaceArea
  27. CalculatePyramidVolume
  28. CalculateRadiusWithArc
  29. CalculateRadiusWithCylinderVolume
  30. CalculateRadiusofCircleCircumfrence
  31. CalculateSinAngle
  32. CalculateSinMissingHypotenuse
  33. CalculateSinMissingOppositeCath
  34. CalculateSphereSurfaceArea
  35. CalculateSphereVolume
  36. CalculateTanAngle
  37. CalculateTanMissingAdjacentCath
  38. CalculateTanMissingOppositeCath
  39. CalculateTime
  40. CalculateTrapezoidSurfaceArea
  41. CalculateVelocity
  42. CalculateVolumeInACylinder
  43. ConvertDaysToHours
  44. ConvertDaysToMinutes
  45. ConvertDaysToMonths
  46. ConvertDaysToSeconds
  47. ConvertDaysToYears
  48. ConvertHoursToDays
  49. ConvertHoursToMinutes
  50. ConvertHoursToMonths
  51. ConvertHoursToSeconds
  52. ConvertHoursToYears
  53. ConvertMinutesToDays
  54. ConvertMinutesToHours
  55. ConvertMinutesToMonths
  56. ConvertMinutesToSeconds
  57. ConvertMinutesToYears
  58. ConvertMonthsToDays
  59. ConvertMonthsToHours
  60. ConvertMonthsToMinutes
  61. ConvertMonthsToSeconds
  62. ConvertMonthsToYears
  63. ConvertSecondsToDays
  64. ConvertSecondsToHours
  65. ConvertSecondsToMinutes
  66. ConvertSecondsToMonths
  67. ConvertSecondsToYears
  68. ConvertYearsToDays
  69. ConvertYearsToHours
  70. ConvertYearsToMinutes
  71. ConvertYearsToMonths
  72. ConvertYearsToSeconds
  73. CustomRoot
  74. ExponentialDecrease
  75. ExponentialIncrease
  76. Factorial
  77. FactorialZeros
  78. FirstBinomialFormula
  79. GetPrimeNumberWithRank
  80. GetTimeZone
  81. LawsOfExponentProductPowerRule
  82. LawsOfExponentsNegativeExponent
  83. LawsOfExponentsPowerOfAPower
  84. LawsOfExponentsProductOfPower
  85. LawsOfExponentsQuotientOfPower
  86. LawsOfExponentsQuotientPowerRule
  87. LawsOfRadicalsProductOfRadicals
  88. LawsOfRadicalsQuotientOfRadicals
  89. LawsOfRadicalsSquareRootInASquareRoot
  90. LawsOfRadicalsSquareRootInExponent
  91. LinearInterpolation
  92. MatrixAdd
  93. MatrixAdjugate
  94. MatrixDeterminant
  95. MatrixInverse
  96. MatrixMinor
  97. MatrixMultiply
  98. MatrixSubtract
  99. MatrixTranspose
  100. PriceDecrease
  101. PriceIncrease
  102. ProbabilityTheory
  103. QuadraticFormula
  104. RectangularRule
  105. RuleOfThree
  106. SecondBinomialFormula
  107. Subfactorial
  108. Tetration
  109. ThirdBinomialFormula
  110. TrapezoidalRule
  111. isPrime
Updates
Version 1
v.1.1.0

– Added more converting methods
– Added Factorials
– Added Average Calculation
– Added Laws of Exponent and Radicals

v.1.2.0

– Added Subfactorials
– Added Getting Zeros out of a factorial
– Added Binomial Formula
– Added Tetration
– Added Quadratic Formula
– Added Custom Roots
– Added Prime calculations
– Added Pyramid Surface area and volume
– removed a print statement accidentally left there

v.1.3.0

– Added Matrix Operations
– Added 2 Integral methods
– Added Getting TimeZones using UTC
– Added Linear Interpolation
– Added Sphere Volume and Area
– LawsOfExponentsMultiplyDifferentValuesWithSameExponent (and division) shortened to LawsOfExponentProductPowerRule
– Made it so that that all functions now show that they will give a number/table

v.1.3.1

– Integral functions are now customisable
– Added Percentage to Number (vice versa) conversion
– Subfactorials now show that you have to insert a number
– Removed another print statement

:warning: REMINDER: If there are some miscalculation made by me, immediately tell if error found

Any recommendation for calculation methods are appreciated!

25 Likes

amazing, will be using it in the future for more math-y projects

what does that mean is this special

4 Likes

I just made it there so it feels more special lol

3 Likes

I am pretty sure it’s like this

local function multiply(x, y) --> I know it's possible in luau but it's an example
   return x * y -- Notice the `return` keyword
end

print(multiply(10, 2)) --> 20

Oof, what a huge list of calculations, Now I don’t have to go to google and search up something and get it, but I wouldn’t use it much as I’m not using math much in roblox

3 Likes

that wasn’t the question but thanks lol

1 Like

Hello! I have updated Calculation Service again! Took me a bit of time to make them but ye. Everything new can be found under the Update Section

This is really cool, well done!
I like how everything is so organized in the module, and easy to understand which is rare now a days. I might try and add some stuff in!

2 Likes

V.1.2.0 is out! All things that got updated are all in the Update Section!

1 Like

Perhaps some interpolation functions would be a nice addition?

1 Like

I think that Linear Interpolations are already covered by Roblox ( Lerp() ) and really the rest is probably in TweenService

1 Like

Saw the function list, and i was sold. i wont only use this. i will study this so i can improve my own math

2 Likes

Hmm… wouldn’t you agree that’s a long function name? It may even cover an entire line of code.

2 Likes

I agree, will change at the next update (is soon btw).

Regarding the comments, I mean yea comments are not that useful but still and maybe fill up the code. But I want to make it so that people can also understand what certain “math words” are and maybe it can help them out a bit :slight_smile:

I’m not sure if i missed it and its already added, but may I suggest adding a lerp function? sometimes people want to lerp only numbers and :Lerp() only works with vector3, CFrame and, Color3.

1 Like

I disagree with the “Don’t write comments” video, I use comments to help me understand, and as a wise man said:

Hungarian is a peek into the world of how people would speak if they spoke in computer code


I remember you helped me in a #help-and-feedback:scripting-support topic, so why not add GetTimezone(timezone: number) to get the timezone

I also agree with @EvilVSCPlays here, I also need the CalculateLinearInterpolation function

I actually did that right after I helped you lol

oh yea and for the Lerp I guess there are 2 methods
(a, b, t)
(y1, y2, x1, x2, n)

I did the first method but idk if i should maybe add the second as basically both work the same

Another update! All update changes are in the Updates Section

Note to Matrix Operation (is used in comments too):

Write out Matrices like this:

local myMatrix = {
	{1, 2, 3},
	{4, 5, 6},
	etc.
}

Next updates will include more physics-based calculations (maybe)

I think it would be better if you let the user pass in the function to integrate rather than having a predefined function.


(Before^^)

(After^^)

1 Like

Sure thing, sounds like a good idea, will patch this today as 1.3.1

1 Like

v1.3.1 out as for quick patches, thanks to @TheBrainy06 for pointing out the function thing, thanks. Anyway everything is inside the Updates Section!