public function createFunctionSerie($SerieName, $Formula = "", array $Options = [])
    {
        $MinX = isset($Options["MinX"]) ? $Options["MinX"] : -10;
        $MaxX = isset($Options["MaxX"]) ? $Options["MaxX"] : 10;
        $XStep = isset($Options["XStep"]) ? $Options["XStep"] : 1;
        $AutoDescription = isset($Options["AutoDescription"]) ? $Options["AutoDescription"] : false;
        $RecordAbscissa = isset($Options["RecordAbscissa"]) ? $Options["RecordAbscissa"] : false;
        $AbscissaSerie = isset($Options["AbscissaSerie"]) ? $Options["AbscissaSerie"] : "Abscissa";

        if ($Formula == "") {
            return null;
        }

        $Result = [];
        $Abscissa = [];
        for ($i = $MinX; $i <= $MaxX; $i = $i + $XStep) {
            $Expression = "\$return = '!'.(" . str_replace("z", $i, $Formula) . ");";
            if (@eval($Expression) === false) {
                $return = VOID;
            }
            if ($return == "!") {
                $return = VOID;
            } else {
                $return = $this->right($return, strlen($return) - 1);
            }
            if ($return == "NAN") {
                $return = VOID;
            }
            if ($return == "INF") {
                $return = VOID;
            }
            if ($return == "-INF") {
                $return = VOID;
            }

            $Abscissa[] = $i;
            $Result[] = $return;
        }

        $this->addPoints($Result, $SerieName);
        if ($AutoDescription) {
            $this->setSerieDescription($SerieName, $Formula);
        }
        if ($RecordAbscissa) {
            $this->addPoints($Abscissa, $AbscissaSerie);
        }
    }
public function createFunctionSerie($SerieName, $Formula = "", array $Options = [])
    {
        $MinX = isset($Options["MinX"]) ? $Options["MinX"] : -10;
        $MaxX = isset($Options["MaxX"]) ? $Options["MaxX"] : 10;
        $XStep = isset($Options["XStep"]) ? $Options["XStep"] : 1;
        $AutoDescription = isset($Options["AutoDescription"]) ? $Options["AutoDescription"] : false;
        $RecordAbscissa = isset($Options["RecordAbscissa"]) ? $Options["RecordAbscissa"] : false;
        $AbscissaSerie = isset($Options["AbscissaSerie"]) ? $Options["AbscissaSerie"] : "Abscissa";

        if ($Formula == "") {
            return null;
        }

        $Result = [];
        $Abscissa = [];
        for ($i = $MinX; $i <= $MaxX; $i = $i + $XStep) {
            $Expression = "\$return = '!'.(" . str_replace("z", $i, $Formula) . ");";
            if (@eval($Expression) === false) {
                $return = VOID;
            }
            if ($return == "!") {
                $return = VOID;
            } else {
                $return = $this->right($return, strlen($return) - 1);
            }
            if ($return == "NAN") {
                $return = VOID;
            }
            if ($return == "INF") {
                $return = VOID;
            }
            if ($return == "-INF") {
                $return = VOID;
            }

            $Abscissa[] = $i;
            $Result[] = $return;
        }

        $this->addPoints($Result, $SerieName);
        if ($AutoDescription) {
            $this->setSerieDescription($SerieName, $Formula);
        }
        if ($RecordAbscissa) {
            $this->addPoints($Abscissa, $AbscissaSerie);
        }
    }
public function createFunctionSerie ( $ SerieName , $ Formula = "" , array $ Options = [ ] ) { $ MinX = isset ( $ Options [ "MinX" ] ) ? $ Options [ "MinX" ] : - 10 ; $ MaxX = isset ( $ Options [ "MaxX" ] ) ? $ Options [ "MaxX" ] : 10 ; $ XStep = isset ( $ Options [ "XStep" ] ) ? $ Options [ "XStep" ] : 1 ; $ AutoDescription = isset ( $ Options [ "AutoDescription" ] ) ? $ Options [ "AutoDescription" ] : false ; $ RecordAbscissa = isset ( $ Options [ "RecordAbscissa" ] ) ? $ Options [ "RecordAbscissa" ] : false ; $ AbscissaSerie = isset ( $ Options [ "AbscissaSerie" ] ) ? $ Options [ "AbscissaSerie" ] : "Abscissa" ; if ( $ Formula == "" ) { return null ; } $ Result = [ ] ; $ Abscissa = [ ] ; for ( $ i = $ MinX ; $ i <= $ MaxX ; $ i = $ i + $ XStep ) { $ Expression = "\$return = '!'.(" . str_replace ( "z" , $ i , $ Formula ) . ");" ; if ( @ eval ( $ Expression ) === false ) { $ return = VOID ; } if ( $ return == "!" ) { $ return = VOID ; } else { $ return = $ this -> right ( $ return , strlen ( $ return ) - 1 ) ; } if ( $ return == "NAN" ) { $ return = VOID ; } if ( $ return == "INF" ) { $ return = VOID ; } if ( $ return == "-INF" ) { $ return = VOID ; } $ Abscissa [ ] = $ i ; $ Result [ ] = $ return ; } $ this -> addPoints ( $ Result , $ SerieName ) ; if ( $ AutoDescription ) { $ this -> setSerieDescription ( $ SerieName , $ Formula ) ; } if ( $ RecordAbscissa ) { $ this -> addPoints ( $ Abscissa , $ AbscissaSerie ) ; } }
Create a dataset based on a formula

@param string $SerieName
@param string $Formula
@param array $Options
@return null
Create a dataset based on a formula