Class SinCalculator
java.lang.Object
io.github.syst3ms.skriptparser.util.math.SeriesCalculator
io.github.syst3ms.skriptparser.util.math.SinCalculator
Calculates sinus using the Maclaurin series.
No argument checking or optimizations are done. This implementation is not intended to be called directly.
I do not claim ownership of this code, it is the intellectual property of @obermuhlner.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidCalculates the factor of the next term.protected PowerIteratorcreatePowerIterator(BigDecimal x, MathContext mathContext) Creates thePowerIteratorused for this series.protected BigRationalReturns the factor of the highest term already calculated.Methods inherited from class SeriesCalculator
calculate, getFactor
-
Field Details
-
INSTANCE
-
-
Method Details
-
getCurrentFactor
Description copied from class:SeriesCalculatorReturns the factor of the highest term already calculated.When called for the first time will return the factor of the first term (index 0).
After this call the method
SeriesCalculator.calculateNextFactor()will be called to prepare for the next term.- Specified by:
getCurrentFactorin classSeriesCalculator- Returns:
- the factor of the highest term
-
calculateNextFactor
protected void calculateNextFactor()Description copied from class:SeriesCalculatorCalculates the factor of the next term.- Specified by:
calculateNextFactorin classSeriesCalculator
-
createPowerIterator
Description copied from class:SeriesCalculatorCreates thePowerIteratorused for this series.- Specified by:
createPowerIteratorin classSeriesCalculator- Parameters:
x- the value xmathContext- theMathContext- Returns:
- the
PowerIterator
-