src/JsPlot3D.js
/**
     * plots a formula into the container as 3D Plot. **Please make sure to link mathjs in your html head** or do it by using plotFunction
     * @param {string} formula string of formula. example: sin(x1) + x3
     * @param {object} variables when formula is something like "x1 + i", use {"i": 2} for example as variables parameter
     * - default: {}
     * - null and undefined will be interpreted as "use default"
     * @param {object} options this is the same as in plotFunction
     */
plots a formula into the container as 3D Plot. **Please make sure to link mathjs in your html head** or do it by using plotFunction
@param {string} formula string of formula.
plots a formula into the container as 3D Plot . ** Please make sure to link mathjs in your html head ** or do it by using plotFunction @param { string } formula string of formula .
plotFormula(formula, variables={}, options={})
    {
        if(typeof(math) == "undefined") 
        {
            console.error("mathjs was not found. Link the script in your html file http://mathjs.org/download.html")
            console.error("or use plotFunction(function(x1, x3) { return x1+x3; }) for example")
            return
        }
        if(variables == null)
        {
            variables = {}
        }
        let compiled = math.compile(formula) 
        this.plotFunction(function(x1, x3)
        {
            variables.x1 = x1
            variables.x3 = x3
            return compiled.eval(variables)
        }, options)
    }
plotFormula ( formula , variables = { } , options = { } ) { if ( typeof ( math ) == "undefined" ) { console . error ( "mathjs was not found. Link the script in your html file http://mathjs.org/download.html" ) console . error ( "or use plotFunction(function(x1, x3) { return x1+x3; }) for example" ) return } if ( variables == null ) { variables = { } } let compiled = math . compile ( formula ) this . plotFunction ( function ( x1 , x3 ) { variables . x1 = x1 variables . x3 = x3 return compiled . eval ( variables ) } , options ) }
plots a formula into the container as 3D Plot.
plots a formula into the container as 3D Plot .
// eslint-disable-line no-undef // eslint-disable-line no-undef