Graphing Calculator



Back

USAGE
The text field to the upper left is where the functions are entered. Press the Enter key on the keyboard to graph the function. The following are examples of valid inputs.

Please note several things from these examples. GCalc is case-INsensitive. The parser changes everything to lowercase before processing it, so SIN is sin is sIN. Also, two mathematical constants are built into GCalc: E (2.718281828...) and pi (3.141592654...). The independent variable is x, which means that all functions must only use x as the variable.

Several keywords such as clear, prev, and next will allow you to manage the functions. I'm working on better ways to let you control what's on the graphing screen. For right now, you can delete a function on the screen by typing ~num, where num is the number assigned to the function by GCalc. The assignment algorithm is pretty simple--it gives the function the lowest number possible. If you entered three functions and deleted ~1 and ~3, only the second function will remain. The next function you type in will have the index 1. The one after that (as long as you don't delete 1 or 2) will be 3. Function are assigned the number when it is first displayed and cannot be changed except by deletion. One can similarly retrieve the numth equation by typing #num. A helpful command will be list which will display the current set of functions on the screen in the Java console.

The following mathematical operations are currently implemented:

  • Binary operators: +, -, *, /, ^
  • Algebraic/Arithmetic operators: sqrt, neg, ln, log, abs, exp, -,
  • Trigonometric operators: sin, cos, tan, csc, sec, cot
  • Trig inverse operators: asin, acos, atan, acsc, asec, acot
  • Hyperbolic Trig operators: sinh, cosh, tanh, csch, sech, coth
  • Hyperbolic Trig inverse operators: asinh, acosh, atanh, acsch, asech, acoth
  • Constants/Variable: x, PI, E, RND
    ln(x) = natural logarithm (base e) of x
    log(x) = common logarithm (base 10) of x
    exp(x) = E^x
    neg(x) = -x
    abs(x) = {x if x>=0; -x if x<0}

    Parentheses, implied multiplication, and overloading of the minus sign operator are supported, hopefully without bugs by now. Operator precedence might be an issue which I might have fudged on, but I haven't detected any major problems with the output.

    Passing the mouse over the graphing screen will give display the cursor's coordinates. Double-clicking will center the graph at that point. I also added a "Box-Zoom" feature. If you drag out a yellow box on the screen, the button that is normally labeled, "Graph-Fit Zoom" will become "Box Zoom." Pressing this button will expand the yellow box to the whole graphing screen.

    All calculations limited to about 15 significant digits. 1.23456789012345 is a number with 15 significant digits. The overflow occurs at about 1.7x10308. Floating point literals are also allowed. "1e1" equals 1x101 to GCalc (which equals 10). This feature makes another feature a little messy. The letter "e" is both used in the sense of ex and 31.4159e-1. The latter sense takes precedence. So, 31.4159e-1 does not equal 31.4159*2.718281828...-1.

    Also, GCalc can only work with real numbers. Therefore, functions such as x^exp(pi*sqrt(-1)) will not produce a graph although it can be rewritten as 1/x.

  •