Script Function ReferenceFunction Reference >Script Function Reference >Function Manipulation>createFunctioncreateFunctioncreateFunction creates a new calculator function.
createFunction(type, name, parameters, equations...)
Parameterstype is a string representing the type of function to create. The allowed values are detailed below.name is a string for the name of the function to create. parameters is a string representing the parameters for the function. Multiple parameters are seperated by a ','. equations are string values defining the function. The number of equations depends on the type. This is detailed below. Return ValuecreateFunction returns the function created in a function table format. It return nil if the function could not be created.Additional InformationThe possible values for type are.
Examplefunction example() createFunction("xy", "parabola", "y", "y^2") createFunction("para3d", "sphere", "u,v", "cos(u)*cos(v)", "sin(u)*cos(v)", "sin(v)") fn = createFunction("user", "dist", "x,y", "sqrt(x^2+y^2)") r = evalFunction(fn, 3, 4) outputString("value="..value.r.."\n") end |