public function sin(int $scale = null): Decimal
    {
        // First normalise the number in the [0, 2PI] domain
        $x = $this->mod(DecimalConstants::PI()->mul(Decimal::fromString("2")));

        // PI has only 32 significant numbers
        $scale = (null === $scale) ? 32 : $scale;

        return self::factorialSerie(
            $x,
            DecimalConstants::zero(),
            function ($i) {
                return ($i % 2 === 1) ? (
                ($i % 4 === 1) ? DecimalConstants::one() : DecimalConstants::negativeOne()
                ) : DecimalConstants::zero();
            },
            $scale
        );
    }
public function sin(int $scale = null): Decimal
    {
        // First normalise the number in the [0, 2PI] domain
        $x = $this->mod(DecimalConstants::PI()->mul(Decimal::fromString("2")));

        // PI has only 32 significant numbers
        $scale = (null === $scale) ? 32 : $scale;

        return self::factorialSerie(
            $x,
            DecimalConstants::zero(),
            function ($i) {
                return ($i % 2 === 1) ? (
                ($i % 4 === 1) ? DecimalConstants::one() : DecimalConstants::negativeOne()
                ) : DecimalConstants::zero();
            },
            $scale
        );
    }
public function sin ( int $ scale = null ) : Decimal { // First normalise the number in the [0, 2PI] domain $ x = $ this -> mod ( DecimalConstants :: PI ( ) -> mul ( Decimal :: fromString ( "2" ) ) ) ; // PI has only 32 significant numbers $ scale = ( null === $ scale ) ? 32 : $ scale ; return self :: factorialSerie ( $ x , DecimalConstants :: zero ( ) , function ( $ i ) { return ( $ i % 2 === 1 ) ? ( ( $ i % 4 === 1 ) ? DecimalConstants :: one ( ) : DecimalConstants :: negativeOne ( ) ) : DecimalConstants :: zero ( ) ; } , $ scale ) ; }
Calculates the sine of this method with the highest possible accuracy
Note that accuracy is limited by the accuracy of predefined PI;

@param integer $scale
@return Decimal sin($this)
Calculates the sine of this method with the highest possible accuracy Note that accuracy is limited by the accuracy of predefined PI ;