Plane Graphic Calculator

Version 1.1
June 2001
The Plane Graphic Calculator is a software tool that interactively displays a graphical view of mathematical functions.

This calculator is intended primarily as an educational aid to understanding the geometric interpretation of mathematical functions.

The calculator allows you to directly manipulate points on the surface of a graph.  These points can represent either complex numbers or 2-dimensional vectors, depending on the selected function.  In addition, the calculator can plot the graphs of real functions and parametrically-defined functions.  The calculator's results are displayed directly on the graph, (as either points or lines), and are automatically kept updated at all times.

The calculator is located in the area below.  If you see only a blank gray space, then you might need to wait for several more seconds while the calculator's files are downloaded across the Internet.  If the calculator does not appear, then you might need to investigate your browser's ability to run Java 1.0 applets. 

Error: Cannot run the Java applet.


 
First-time users
If you're a first-time user, here are some things to try with the calculator:
  1. Hold down the left mouse button on point a or b, and move it around.  The point f represents the sum a+b.  The three points represent either complex numbers or vectors.
  1. If you keep both a and b on the horizontal x axis, you'll see that a+b works just like it does for real numbers on the number line.  That's true for most of the calculator's functions.
  1. Click the box labeled Function to select another built-in function.
  1. In the box at the bottom left, type 2x+1, then hit the Enter key.
  1. In the box at the bottom right, type sin x, then hit the Enter key.
  1. Hold down the right mouse button anywhere on the graph and move it around.
  1. Click the box labeled Function and scroll it down to select some more examples of user-defined functions.  Some additional examples are also provided on this page.
 
Index
Plane Graphic Calculator
First-time users
Index
Basic calculator usage
User-defined functions
Calculator installation and configuration
Graph definitions and mathematics
Additional examples
Entering polar equations
Mathematical reference
Version history
   
Basic calculator usage
  • Graph mouse usage

    The mouse can be used directly on the surface of the graph for selecting and moving points.  If a point is labeled a, b, c, or d, then you can move it with the mouse.  You can select a point by placing the mouse cursor on it and clicking the left mouse button.  You can move the point by holding down the left mouse button and dragging the mouse.  Once you have selected or moved a point, then it becomes the active point, which is useful for several other features described below.

    You can scroll the graph by holding down the right mouse button and dragging the mouse.  (If you have a one-button mouse, then you can hold down the Ctrl key as you click the mouse button.)

    While you're moving a point, you can hold down the Shift key to "snap" the point onto the nearest integer.

     
  • Control panel
    • Click the box labeled Function to change the mathematical function displayed by the graph. 
    • Click the + and - buttons to zoom in and out.  The current zoom scale is displayed on the control panel.  The zoom scale is the number of pixels between the points (0,0) and (1,0) on the graph. 
    • Click the Plot checkbox if you want the result point to draw a continuous line as it moves.
    • Click the Spin checkbox to begin an animated display that spins the active point around the origin.  (You can set point a, b, c, or d as the active point by clicking the mouse on it.)  Studying the spin animation can be helpful for understanding how a function behaves.
    • Click the Line checkbox if you want each point to be displayed with a line connecting it to the origin.
    • Click the Details button to display a new window containing the numeric coordinates of the points.  You can change these coordinates to move the points.
    • Click the Step button to move point a to point f.  This feature can be useful for exploring the iterative behavior of functions.
    • Click the Clear button to clear all plotted lines.
    • Click the About button to display a new window containing information about the identity of the calculator.
    • Click the Detach button to detach the calculator window from the web page.  After the calculator is detached, you can resize it.  (The calculator cannot be resized while it's attached to the web page.)
    • The user-defined functions f and g are located at the bottom of the control panel.  You can type a general mathematical expression into either box, and the calculator will display a graph of it.
     
  • Graph keyboard usage

    The graph must be selected before you can fully control it from the keyboard.  You can select the graph by clicking the mouse anywhere on it, or by hitting the Esc key.
    • Hit the arrow keys to move the active point by 1 pixel.
    • Hold the Shift key down while hitting the arrow keys to move the active point by 5 pixels.
    • Hold the Ctrl key down while hitting the arrow keys to scroll the graph by 20 pixels.
    • Hit the + and - keys to zoom in and out.  (The = key can also be used to zoom in.)
    • If more than one input point is displayed on the graph, then you can hit the N key to switch the active point from one to the next.
    • Hit the P key to start and stop the plotting feature.
    • Hit the S key to start and stop the spinning of the active point.
    • Hit the C key to clear all plotted lines.
    • Hit the L key to show and hide the lines that connect each point to the origin.
    • Hit the Z key to restore the zoom scale and position of the graph to their original settings.
    • Hit the space bar key to advance one step.  A "step" moves point a to point f.
    • Hit the > key to advance 100 steps.
     
  • Built-in functions

    The calculator contains the following built-in functions.  These can be accessed by clicking on the box labeled Function:

     calculator 
     symbol 
     mathematical 
     function 
     complex 
     mathematics 
     vector 
     mathematics 
     special 
     feature 
     f = a + b   f = a + b   complex addition   vector addition   
     f = a - b   f = a - b   complex subtraction   vector subtraction   
     f = a *  f = ab   complex multiplication      
     f = a / b 
     f = 
    a
    b
     complex division      
     f = a ^ b   f = ab   complex power      
     f = a ·  f = a · b      vector dot product   projection vector 
     f = a × b   f = a × b      vector cross product   projection vector 
     f = mat(a,b) ·
     f = 
    ax ay
    bx by
     c 
        matrix multiplication   projection vectors 
     f = V¯a   z2 = a   complex square roots      roots 
     f = 3V¯a   z3 = a   complex cube roots      roots 
     f = exp a   f = ea  complex exponential      

     
  • Built-in examples

    The calculator contains the following built-in examples of user-defined functions.  These can be accessed by clicking on the box labeled Function:

    Example 1:  Midpoint function
    Example 2:  Manipulating a point's x and y coordinates
    Example 3:  Straight line and parabola
    Example 4:  Interactive sine curve
    Example 5:  Parametric functions: circle and interactive line
    Example 6:  Parametric functions: interactive ellipse
    Example 7:  Plot the regular pentagon (click Step 5 times)
    Example 8:  Interactive spirals from the complex powers of i

    Some additional examples are also provided on this page.

     
  • Details window

    Click the Details button to display the Details window.

    The Details window contains the following sections:
    • The Point coordinates section shows the coordinate values for each displayed point.  Click a coordinate number if you want to change its value.  You can enter any real number or real expression as a coordinate value, for example: -1.75 or pi/4 or sqrt 2.  After you're finished typing a new coordinate value, you can hit the Enter key (or click the mouse elsewhere) to update the graph.  On some systems, you can also hit the Tab key to navigate among the coordinate fields.  You cannot change coordinate values that are displayed in a gray field.
    • The Additional user-defined functions section contains the definitions for the user-defined functions h, k, m, and n.
    • The Parametric variable section allows you to control the behavior of the parametric variable t used in the autoplot feature.  The t variable can appear in any user-defined function, where it causes the function to be plotted as t varies across a range of real values.  You can specify the endpoints of this range in the first two boxes.  You can specify the number of points to be plotted in the rightmost box.  The plotted points are equally distributed across the range.
    • The calculator displays error messages at the bottom of the Details window.  An error message is displayed if you enter a malformed expression for a user-defined function.
     
  • Step button

    The Step button has two effects:
    1. Clicking the Step button moves point a to point f.  This feature can be useful for exploring the iterative behavior of functions.

      For example, you can explore the iterative function that's used to generate the Mandelbrot set by defining f = a^2+c.  Click the Step button to advance through the iterations.
       
    2. Clicking the Step button increments the value of the step variable s.  The variable s can be used in user-defined functions to provide a well-controlled source of incremental input.

      For example, you can step through the power sequence by defining f = x^s.  Click the Step button to advance through the sequence for s=0, s=1, etc. 
    The number displayed on the Step button indicates how many times it has been clicked since the Clear button was last clicked.

  •  
    User-defined functions
    This section describes how to customize the function that's displayed by the calculator.

    You can enter mathematical expressions into the boxes labeled f and g.  After you're finished typing an expression, you can hit the Enter key (or click the mouse elsewhere) to update the graph.

    The functions f and g can be defined and displayed independently of each other.  To define more than two functions at the same time, you can click the Details button, which displays a new window allowing you to define up to four additional functions, named h, k, m, and n.  Each function is displayed on the graph in a different color:
      f
     is blue
      g
     is red
      h
     is green
      k
     is magenta
      m
     is cyan
      n
     is gray

    A good way to learn how to develop user-defined functions is to study the built-in examples in the calculator, or to look at the additional examples provided on this page.

     
  • Expression table

    A mathematical expression is built by combining the expressions listed in the following table:

     syntax   level   semantics 
     expr , expr  0  creation of a vector from x and y components 
     expr or expr  1  logical or 
     expr and expr  2  logical and 
     expr = expr 
     expr == expr 
    3  equal 
     expr <> expr 
     expr != expr 
    3  not equal 
     expr < expr  3  less than (x component is dominant) 
     expr <= expr  3  less than or equal (x component is dominant) 
     expr > expr  3  greater than (x component is dominant) 
     expr >= expr  3  greater than or equal (x component is dominant) 
     expr dot expr  4  vector dot product 
     expr cross expr  4  vector cross product 
     expr + expr  5  addition 
     expr - expr  5  subtraction 
     expr  expr 
     expr * expr 
    6  complex multiplication 
     expr / expr  6  complex division 
     expr rem expr  6  remainder (on the x component only) 
     expr mod expr  6  modulo (on the x component only) 
     expr ^ expr  7  complex power 
     + expr  8  (the identity operator) 
     - expr  8  complex negation 
     not expr  8  logical not 
     re expr  8  extraction of the x component 
     im expr  8  extraction of the y component (as a real value) 
     realonly expr  8  the value of expr, but undefined unless expr is real 
     int expr  8  truncate to integer (independently on both x and y
     ceil expr  8  ceiling integer (independently on both x and y
     floor expr  8  floor integer (independently on both x and y
     sign expr  8  the sign of expr, or its collinear unit vector 
     abs expr  8  complex absolute value, or vector length 
     arg expr  8  complex argument, or vector angle 
     conj expr  8  complex conjugate 
     sqrt expr  8  complex square root 
     exp expr  8  complex exponential eexpr 
     log expr 
     ln expr 
    8  complex natural logarithm 
     sin expr  8  complex sine 
     cos expr  8  complex cosine 
     tan expr  8  complex tangent 
     cot expr  8  complex cotangent 
     sec expr  8  complex secant 
     csc expr  8  complex cosecant 
     sinh expr  8  complex hyperbolic sine 
     cosh expr  8  complex hyperbolic cosine 
     tanh expr  8  complex hyperbolic tangent 
     coth expr  8  complex hyperbolic cotangent 
     sech expr  8  complex hyperbolic secant 
     csch expr  8  complex hyperbolic cosecant 
     asin expr 
     arcsin expr 
    8  complex inverse sine 
     acos expr 
     arccos expr 
    8  complex inverse cosine 
     atan expr 
     arctan expr 
    8  complex inverse tangent 
     acot expr 
     arccot expr 
    8  complex inverse cotangent 
     asec expr 
     arcsec expr 
    8  complex inverse secant 
     acsc expr 
     arccsc expr 
    8  complex inverse cosecant 
     asinh expr 
     arcsinh expr 
    8  complex inverse hyperbolic sine 
     acosh expr 
     arccosh expr 
    8  complex inverse hyperbolic cosine 
     atanh expr 
     arctanh expr 
    8  complex inverse hyperbolic tangent 
     acoth expr 
     arctoth expr 
    8  complex inverse hyperbolic cotangent 
     asech expr 
     arcsech expr 
    8  complex inverse hyperbolic secant 
     acsch expr 
     arccsch expr 
    8  complex inverse hyperbolic cosecant 
     expr . x  9  extraction of the x component 
     expr . y  9  extraction of the y component (as a real value) 
     ( expr )  9  definition of a subexpression 
     | expr |  9  complex absolute value, or vector length 
     number      a real number value, or the vector (number,0) 
     i      the complex number V¯-1, or the vector (0,1) 
     j      the complex number V¯-1, or the vector (0,1) 
     pi      the real number 3.14159265358979324 
     e      the real number 2.71828182845904524 
     infinity      the infinity value (example: the result of 1/0) 
     NaN      the "Not a Number" value (example: the result of 0/0) 
     a      the value of point a (a complex or vector value) 
     ax      the x component of point a (a real value) 
     ay      the y component of point a (a real value) 
     b      the value of point b (a complex or vector value) 
     bx      the x component of point b (a real value) 
     by      the y component of point b (a real value) 
     c      the value of point c (a complex or vector value) 
     cx      the x component of point c (a real value) 
     cy      the y component of point c (a real value) 
     d      the value of point d (a complex or vector value) 
     dx      the x component of point d (a real value) 
     dy      the y component of point d (a real value) 
     f      the expression defined by function f 
     fx      the x component of function f 
     fy      the y component of function f 
     g      the expression defined by function g 
     gx      the x component of function g 
     gy      the y component of function g 
     h      the expression defined by function h 
     hx      the x component of function h 
     hy      the y component of function h 
     k      the expression defined by function k 
     kx      the x component of function k 
     ky      the y component of function k 
     m      the expression defined by function m 
     mx      the x component of function m 
     my      the y component of function m 
     n      the expression defined by function n 
     nx      the x component of function n 
     ny      the y component of function n 
     x      the value of the autoplot variable (a real value) 
     t      the value of the autoplot variable (a real value) 
     s      the value of the step variable (an integer value) 
     z      the value of the current zoom scale (an integer value) 

     
  • Lexical and syntactic issues

    This section contains a technical discussion of the lexical and syntactic issues for the mathematical expressions used by the calculator.  You can skip over many of the items in this section if you already understand the basic principles of using expressions in software programming languages such as C and Java.
    • In the expression table, each entry defines a different kind of expression.  The name expr is a place-holder that can be replaced by any kind of expression.  For example, the table shows that "x" and "pi" are both expressions -- therefore, they can be used to replace the two place-holders in "expr + expr" to create the expression "x + pi".
    • In the expression table, the level number determines the order in which the operators are applied.  Whenever possible, operators at a higher level are applied before those at a lower level -- even if it causes the operators to be applied in a right-to-left order.  For example, in the expression "3+x/2", the / operator is applied before the + operator.  When operators at the same level are adjacent, they are applied in a right-to-left order (for level 8), or in a left-to-right order (for all other levels).
    • The order of evaluation cannot be changed by inserting spaces into the expression.  For example, the expression "cos 2x" is always interpreted to mean "(cos 2) * x", even though the original spacing might suggest otherwise.  You can always use parentheses to specify the desired evaluation order, for example: "cos (2x)".
    • In most cases, you should use parentheses around the comma expression.  The comma operator is at the lowest level -- and without parentheses, it's likely that adjacent operators will be applied in an inappropriate order.  For example, the expression "a + 0,1" is always interpreted to mean "(a + 0) , 1".  If you add parentheses around the comma expression, "a + (0,1)", it will more likely reflect your intended meaning.
    • The ambiguous expressions "expr + expr" and "expr - expr" are resolved by disallowing the empty multiplication operator if it immediately precedes a unary + or unary - operator.  For example, compare the four expressions "2 x", "x 2", "-2 x", and "x -2".  Each expression is evaluated as a multiplication except for "x -2", which is instead evaluated as a subtraction.
    • The operator "| expr |" cannot be directly nested inside itself.  To nest this operator, you must enclose the inner operator in parentheses.  Example: "| ( | a | ) - ( | b | ) |".
    • A number is composed of a sequence of one or more digits, including an optional decimal point.  This sequence of digits can optionally be followed by one of the following suffixes:
        Eexponent
        E+exponent
        E-exponent
      where exponent is a sequence of one or more digits.  If a suffix is used, then the value of the number is scaled by the specified power of 10.  For example, "2.5E4" is equal to "25000". 
    • Two adjacent names must be separated by a space.  For example, the expression "2ti" is malformed, and must be written as "2t i" or "2t*i".
    • Two adjacent numbers must be separated by a space.  Also, if a number is followed by the constant e (= 2.71828182845904524), then the e must be preceded by a space.
    • Letters can be used in either uppercase or lowercase.
    • Comments are enclosed in braces: { }.  Comments can be nested.
     
  • Semantic issues

    This section contains a discussion of the semantic issues for the mathematical expressions used by the calculator.  This section is provided for advanced users who want a detailed understanding of these expressions.
    • All expressions yield a value of the same type, which can be called the "complex" or "vector" type.  The calculator makes no distinction between a "complex" value and a "vector" value.  As an example, the calculator considers the expressions 1+i and (1,1) to be semantically identical.  If an expression is described as having a "real" value, this simply means that its y component is 0.
    • Each expression has a defined value, or an undefined value.  An expression has an undefined value if it's empty, if it contains certain syntactic errors, or if it references an undisplayed point.  If an operator is applied to an undefined value, then its resulting value is also undefined.  An undefined value is not displayed as a point, and is not plotted.
    • Either component of an expression's value may be infinity, -infinity, or NaN.  The infinity value results from a calculation such as 1/0.  The NaN value ("Not a Number") results from a calculation such as 0/0.  If arithmetic is performed with these special values, the result is as defined by the IEEE 754 standard specification.  (For example, 1/infinity = 0.)  If either component of an expression's value is infinity, -infinity, or NaN, then it is not displayed as a point, and is not plotted.
    • If a user-defined function contains either x or t in its definition, then the function is not displayed as a point on the graph.  Instead, the usage of x or t triggers the autoplot feature, which causes the function to be plotted over a range of values for x or t.
    • A user-defined function can contain the name of another function in its definition, as long as the chain of definitions is not recursive.  For example, the recursive chain of definitions f = g+1, g = h+1, and h = f+1 results in all three functions having an undefined value.
    • The expression (realonly expr) is undefined unless expr is real -- in which case it yields the same value as expr.  This operator is provided so that you can prevent an expression from yielding a non-real value.
      As a special case, the realonly operator considers the expr to be "real" if it would be displayed on the graph using the same pixel as the expression (re expr).  This means that a non-real value may actually be considered "real" by the realonly operator -- if its y component is sufficiently small in magnitude.
      This looser definition of "real" can be useful because, sometimes, small errors will occur in the calculator's arithmetic that prevent a value from having a y component exactly equal to 0 -- even though the value is known to be real in mathematical theory.
    • The operators =, ==, <>, !=, <= and >= consider their operands to be "equal" if they would be displayed on the graph using the same pixel.  This means that non-equal values may actually be considered "equal" if their difference is sufficiently small in magnitude.
      This looser definition of "equal" can be useful because, sometimes, small errors will occur in the calculator's arithmetic that prevent two values from being exactly equal, even though they are known to be equal in mathematical theory.
    • The comma-operator expression is defined as:
        expr1 , expr2  =  re(expr1) + i * re(expr2)
      Note that this operator causes the imaginary components of expr1 and expr2 to be discarded.
     
  • The autoplot variables x and t

    The calculator has an autoplot feature that can be used to easily plot the graph of a mathematical function.

    The autoplot feature is triggered whenever a function is defined in terms of either x or t.

    A function containing x or t is automatically evaluated many times -- each time with a different real value for x or t -- and the resulting values are all plotted on the graph.

    The variable x is used to plot real functions of the form y = function(x).  If the function doesn't yield a real result for certain values of x, then the calculator does not plot anything for those values.  This omission can be desirable when plotting real functions such as sqrt (1-x^2) and arcsin x, which are defined only within a limited range of values for x.

    The variable t is used to plot functions that yield a complex or vector value, such as e^(i*t) or (t^2, 2t).  To create a useful plot, you should generally use t in both the x and y components of the function.  The variable t is also called the parametric variable.

    Plots based on t can sometimes be inaccurate due to granularity distortion.  This distortion can be illustrated by comparing the plots of cos (8x) and (t, cos (8t)).  The t-based plot may show sections of the curve that appear flat or misshapen.  Granularity distortion is also responsible for the uneven texture in the plot of (cos t, sin t).  This distortion can be improved by adjusting the settings located in the Detail window's Parametric variable section.

    Another important difference between x and t can be illustrated by comparing the plots of log x and (t, log t).  The plot of log x is accurate because it omits the unplottable values where x<0.  The plot of (t, log t) is similar, but it shows misleading plot lines where x<0.  These extraneous plot lines are generated because the imaginary component of log t is discarded when the calculator creates the vector (t, log t); and, in fact, the calculator is actually plotting (t, re(log t)).  These extraneous lines can be prevented by changing the function to (t, realonly(log t)).  The realonly operator is undefined unless its argument is real.

    The variable x gets its values from the x coordinates of the points that correspond to all the pixels displayed horizontally within the current graph window.  To increase the x-plotting speed, you can resize the calculator window to a narrower width.

    The variable t gets its values from the range that's specified in the Details window.  To increase the t-plotting speed, you can specify fewer points to be plotted.

    If both x and t are used in the same expression, then x = t, and the plotting rules for t are applied to both variables.

    If a function uses the autoplot feature, then each function that refers to it automatically inherits the autoplot feature.  For example, the functions f = sqrt (1-x^2) and g = -f can be used together to plot the unit circle.

     
  • The step variable s

    The calculator has a step variable named s.  This variable contains the number that appears on the Step button.  (If the Step button does not show a number, then s=0.)  You can increment this number by clicking the Step button.

    This feature allows you to provide a well-controlled source of incremental input for exploring a related family of functions.  For example, s can be used to easily step through the power sequence x^s for s=0, s=1, etc.

    It can also be useful to control the plotting of a function.  For example, i^(4s/5) is the formula for generating the vertices of a regular pentagon (for integer values of s).  To plot the pentagon, you can:
    1. enter the function i^(4s/5),
    2. activate the Plot checkbox,
    3. click the Step button 5 times.
    The value of s indicates how many times the Step button has been clicked since the Clear button was last clicked.  Its value is always a non-negative integer.

  •  
    Calculator installation and configuration
    You can download this calculator and install it locally on your computer, or you can embed the calculator inside another web page.

    For a minimum installation, you can download the following two files into the same folder:
        -- the calculator program file
        -- a web page to run the calculator
    For a complete installation, you can download the following zip file:
    You can launch the calculator by opening the file PGC.htm.  To embed the calculator in another web page, use the following HTML statement:
      <applet
         code="PGC.class"
         archive="PGC.jar"
         width=560
         height=440>
      </applet>
    If you're using this calculator only to illustrate a specific example on a web-page, then you will need to configure it by using param tags.  The following example shows how to do this:
      <applet
         code="PGC.class"
         archive="PGC.jar"
         width=250
         height=100>
      <param name=launch_button value="">
      <param name=launch_size value="">
      <param name=control_panel value=0>
      <param name=graph_border value=0>
      <param name=background_image value="">
      <param name=builtin_functions value=0>
      <param name=builtin_examples value=0>
      <param name=center value="(0,0)">
      <param name=zoom value=20>
      <param name=line value=0>
      <param name=plot value=0>
      <param name=spin value=0>
      <param name=active value="a">
      <param name=t_minimum value=-10.0>
      <param name=t_maximum value=10.0>
      <param name=t_count value=200>
      <param name=a value="(pi/2, 1)">
      <param name=b value="">
      <param name=c value="">
      <param name=d value="">
      <param name=f value="sin(x/ax * pi/2) * ay">
      <param name=g value="">
      <param name=h value="">
      <param name=k value="">
      <param name=m value="">
      <param name=n value="">
      </applet>
    The above example displays the following calculator:
    Move point a with the mouse to see how the amplitude and frequency of a sine wave can change.
     
    Graph definitions and mathematics
    This section contains a technical description of the calculator's graph.  You can skip over many of the items in this section if you already understand the basic principles of complex numbers, vectors, their corresponding representation on the cartesian plane, and their standard graphical display conventions.

     
  • Pixels, points, and zoom scale

    The calculator's graph is a map that projects points in the cartesian plane onto screen pixels.

    The zoom scale (z) is defined as the horizontal pixel displacement between the pixel that represents the cartesian point (0,0) and the pixel that represents the cartesian point (1,0). 

    If the screen location of the cartesian origin's pixel o is at ox (horizontal) oy (vertical), and the screen location of pixel p is at px (horizontal) py (vertical), then pixel p is the graphical representation of the cartesian point a with coordinates:
      ax = (px - ox) / z
      ay = (oy - py) / z.
    Pixel p is also the graphical representation of the following set of cartesian points:
      { (x,y)  |  x in [ax - z/2  ...  ax + z/2)  and  y in [ay - z/2  ...  ay + z/2) }.
    Point a is called the center point for pixel p.  If you select pixel p with the mouse, then the calculator interprets it as point a.

    The calculator uses only positive integer values for z.  This allows you to use the mouse for selecting integer-valued coordinates.  If you choose an even value for z, then you can also use the mouse to select exact mid-points between integers.

    Due to limitations in the calculator's graphing precision, it's best to limit your activities to the region of the cartesian plane where the following inequality holds true for each point a that you're using:
      max(z|ax|, z|ay|)  <  2147483647
     
  • Background pixel color

    If the background color of a pixel is black, then it represents a point a that has a coordinate value of either ax=0 or ay=0.

    If the background color of a pixel is light gray, then it represents a point a that has a coordinate value such that either ax or ay is a non-zero integer -- however, at very low zoom scales, ax or ay is also restricted to be an integer multiple of 10.

    The background color of all other pixels is white.

     
  • Mathematical interpretation of points

    Each point on the plane has two coordinates, a horizontal one for x, and a vertical one for y.  The mathematical interpretation of these coordinates depends on which function is currently selected for the calculator.  This interpretation is defined either by complex mathematics, vector mathematics, or real mathematics.

    In complex mathematics, the point represents a complex number, where the point's x coordinate represents the number's real component, and the point's y coordinate represents the number's imaginary component.  Specifically, the point a located at (ax,ay) represents the complex number ax+iay, where i2 = -1.  (In some applications, the symbol j is used instead of i.)

    In vector mathematics, the point represents a 2-dimensional vector, where the point's x coordinate represents the vector's first coordinate, and the point's y coordinate represents the vector's second coordinate.  Specifically, the point a located at (ax,ay) represents the vector (ax,ay).

    In real mathematics, the point represents either true or false with respect to a function f : , where the point's x coordinate represents a value in the domain of f, and the point's y coordinate represents a value in the range of f.  Specifically, the point a located at (ax,ay) represents true if ay = f (ax), and represents false otherwise.

     
  • Labeled points

    The calculator labels some of the points on the plane.

    The labeled points are used to highlight the input(s) and output(s) of the calculator's currently-defined function(s).

    A labeled point is displayed as a small open square that's centered around the pixel that represents it.  The point may also be accompanied by a gray line segment that connects it to the origin.  The gray line segment is provided only to help you visualize the angle associated with the point, and is not a part of the mathematical object that the point represents.

    Note that sometimes a point might lie outside of the display boundary of the graph.  The Line checkbox is provided to help you locate a distant point.

     
  • Root functions

    The calculator's built-in function f = V¯a displays all the complex values of z that satisfy the equation z2 = a.

    The calculator's built-in function f = 3a displays all the complex values of z that satisfy the equation z3 = a.

    Each of these equations has a principal root, which is displayed as the point labeled f.  The principal root is the value of z that has the greatest real component (or the greatest imaginary component if the real components are equal).  All other roots of the equation are displayed as unlabeled points.

    See also:

     
  • Projection vector

    The calculator has a special feature to help you understand the geometric interpretation of a · b (vector dot product) and a × b (vector cross product).

    This feature is available when you select the built-in function f = a · b or f = a × b.

    While you are moving a point with the mouse (or while the spin animation is running), an additional point is displayed that represents the projection vector.  The projection vector is displayed in red, and it describes the "shadow" that the moving vector casts on the stationary vector's line.  This shadow comes from a light source that's positioned so its rays of light are always perpendicular to the stationary vector.  The shadow is created when the moving vector blocks one ray of light.  This blocked ray of light is displayed as a yellow line segment. 

    The shadow that a casts on b is the vector b(a·b)/|b|2.  In this case, the red line has a length of |a·b|/|b|, and the yellow line has a length of |a×b|/|b|.  If b remains constant (which is true while you are moving a), then the length of the red line is always proportional to |a·b|, and the length of the yellow line is always proportional to |a×b|.  Observing these relationships can be useful for achieving a geometric understanding of these vector products.

    See also:

     
  • Projection vectors for matrix multiplication

    The calculator has a special feature to help you understand the geometric interpretation of 2×2 matrix multiplication with a vector.

    This feature is available when you select the built-in function f = mat(a,b) · c.

    For this function, the calculator computes the following:
      ax ay
      bx by
       c 
    = (a · c , b · c)
    While you are moving point c with the mouse (or while the spin animation is running on c), two additional points are displayed that represent the projection vectors.  The projection vectors are displayed in red, and they describe each of the two "shadows" that c is simultaneously casting on the lines of a and b.

    These shadows come from two different light sources that are positioned so that the rays of light from one source are always perpendicular to a, and the rays of light from the other source are always perpendicular to b.  The two shadows are created when c blocks one ray of light from each source.  These two blocked rays of light are displayed as yellow line segments.

    The two projection vectors are labeled x and y, and are defined as:
      x = a(a·c)/|a|2           |x| = |a·c|/|a|
      y = b(b·c)/|b|2           |y| = |b·c|/|b|

    If a and b remain constant (which is true while you are moving c), then the lengths of the red shadows |x| and |y| are always proportional to |a·c| and |b·c|, respectively.  Observing this relationship can help you to view the result vector (a·cb·c) in geometric terms.

    See also:

  •  
    Additional examples
    This section contains some additional examples of user-defined functions for the calculator.

     
  • Cycloid
      f  =  (|a|t + by sin t , by cos t)
      g  =  |a|(cos t, sin t)
      Move a and b up and down the y axis.  The radius of the circle is |a|, and by indicates where the pen is attached to the circle.  The pen draws the cycloid as the circle rolls in the x direction.
     
  • Projectile motion
      f  =  bx|t|, by|t| + .5 ay|t|^2
      Move b to specify the initial velocity vector of a projectile fired from the origin.  Move ay to a negative value to specify the negative acceleration of gravity.  The curve shows the resulting ballistic motion of the projectile.
     
  • Normal distribution
      f  =  (1/((dx-cx)sqrt(2pi))) e^(-((x-cx)^2)/(2(dx-cx)^2))
      g  =  (cx, t)
      h  =  (dx, t)
      Move c to specify the mean, and move d to specify 1 standard deviation from the mean.  The curve shows the normal distribution.
     
  • 2×2 matrix exploration
      f  =  (cos t, sin t) dot a, (cos t, sin t) dot b
      g  =  (1,1)i^(int t) dot a, (1,1)i^(int t) dot b
      Move a and b around to explore how multiplication by a 2×2 matrix transforms the geometry of the plane.  The graph shows how the unit circle and a circumscribed square are transformed by multiplication with the following matrix:
        ax ay
        bx by
     
  • Regular polygons
      f  =  c + (a-c) i^((4 int t)/(s+3))
      Move a and c to position the polygon.  Click the Step button to advance to the next polygon.  Click the Clear button to reset.
     
  • Conic sections with focus and directrix
      f  =  sqrt(ax+1)
      g  =  -f
      h  =  sqrt(ax*((x^2)-1))
      k  =  -h
      m  =  (re(1/f), ax*im(1/f)) + i*t/f
      n  =  -m
      Move a left and right to explore the entire set of ellipses and hyperbolas.
     
  • Chaos of the logistic equation
      f  =  4ax(1-ax)
      g  =  (s/z, f)
      Move a to random position between x=0 and x=1.  Activate the Plot checkbox, and then click the Step button to advance through the iterations.  Hit the > key to advance 100 steps.  The resulting plot is chaotic.  Click the Clear button to reset.
     
  • Mandelbrot set
      Move c to a fixed location.  Move a to 0, and then click the Step button to advance through the iterations.  If c is inside the colored area, and a starts at 0, then a will never escape to infinity.  (If you move c, then be sure to move a back to 0 before continuing.)  It's interesting to activate the Plot checkbox as you step through the iterations.
  •  
    Entering polar equations
    Curves are sometimes defined using polar equations.  For example, the following equation is often used to define the cardioid:
      r  =  1 + cos
    You can enter this equation into the calculator as:
      (1 + cos t) (cos t, sin t)

    In general, you can enter a polar equation into the calculator by making the following changes to it:
    1. Change to t. 
    2. Consistently rename all the constants to ax, bx, cx, or dx. 
    3. Delete the "r =" from the beginning of the equation. 
    4. Enclose the entire expression in parentheses. 
    5. Multiply it by (cos t, sin t). 
    The following examples demonstrate some common polar equations, and how you can enter them into the calculator:


  • Logarithmic spiral
      Polar:  r  =  a eb 
      Enter: ax e^(bx t) (cos t, sin t)

  • Archimedean spiral
      Polar:  r  =  n   (for > 0) 
      Enter: ax |t| (cos |t|, sin |t|)

  • Limaçons and rhodonea
      Polar:  r  =  k + cos n 
      Enter: (ay + cos(ax t)) (cos t, sin t)

  • Conic sections
      Polar:  r  =  (1 + e) / (1 + e cos ) 
      Enter: ((1 + ax) / (1 + ax cos t)) (cos t, sin t)
  •  
    Mathematical reference
    This section contains some basic definitions for the mathematics used by the calculator.

     
  • Complex representation: rectangular form

    A complex number z can be represented in rectangular form as zx+izy, where zx is the real component, zy is the imaginary component, and i2 = -1.  The individual components can be extracted by applying the following definitions:
      Re(z) = zx
      Im(z) = zy
     
  • Complex representation: polar form

    A complex number z can be represented in polar form as the pair <|z|,> where |z| is the length of the line segment from 0 to z, and is the angle between the positive real axis and the line segment from 0 to z, as measured counter-clockwise from the positive real axis in radians.  (If the angle is measured clockwise, then has a negative value.)

    The rectangular form is converted to the polar form by applying the following definitions:
      |z| = V¯(zx2 + zy2)
    and
        =  0     if zx = 0 and zy = 0
        =  - arccos(zx / |z|)    if zy < 0
        =  arccos(zx / |z|)    otherwise
    The polar form is converted to rectangular form by multiplying |z| with the complex number on the unit circle that corresponds to :
      z = <|z|,>
        = |z| (cos + i sin )
        = |z| cos + i |z| sin
    Therefore:
      zx = |z| cos
      zy = |z| sin
    A complex number does not have a unique representation in polar form.  Specifically: <|z|, +2k> represents the same complex number for all integer values of k.  Also, if |z|=0, then <|z|,> represents the complex number 0 for all real values of .  The polar form is often normalized by selecting in the range (- ... ], and selecting =0 if |z|=0.

    The polar coordinate |z| is sometimes called the modulus, the magnitude, or the absolute value of z.  The polar coordinate is sometimes called the argument or the phase of z.

     
  • Complex representation: phasor form

    A complex number z can be represented in phasor form as |zei, where |z| and are defined as in the polar form.  The phasor form is converted to rectangular form by applying Euler's formula:
      z = |zei
        = |z| (cos + i sin )
        = |zcos + i |z| sin

     
  • Vector representation: polar form

    A 2-dimensional vector v can be represented in polar form as the pair <|v|,>.  Their definitions are analogous to those given above for complex numbers in polar form.

    The polar coordinate |v| is sometimes called the length or magnitude of v.  The polar coordinate is sometimes called the angle of v.

     
  • Complex conjugate

    The complex conjugate is defined as:
      _
      a  =  ax - iay
     
  • Addition

    Complex addition is defined as:
      a + b = (ax+iay) + (bx+iby) = (ax+bx) + i(ay+by)
    Vector addition (in two dimensions) is defined as:
      a + b = (ax,ay) + (bx,by) = (ax+bx , ay+by)
     
  • Subtraction

    Complex subtraction is defined as:
      a - b = (ax+iay) - (bx+iby) = (ax-bx) + i(ay-by)
    Vector subtraction (in two dimensions) is defined as:
      a - b = (ax,ay) - (bx,by) = (ax-bx , ay-by)
     
  • Complex multiplication

    Complex multiplication is defined as:
      a * b = (ax+iay) * (bx+iby) = (axbx-ayby) + i(axby+aybx)
    and in polar form:
      a * b = |a| (cos a + i sin a) * |b| (cos b + i sin b)
      =
      |a| |b|  (  (cos a cos b  -  sin a sin b)
       + i (cos a sin b  +  sin a cos b) )
      = |a| |b| (cos (a + b) + i sin (a + b))
      = < |a| |b| , (a + b) >
    and in phasor form:
      a * b = (|a| ei) * (|b| ei) = |a| |b| ei(+)
     
  • Complex division

    Complex division is defined as:
      a / b =
      (ax+iay)
      (bx+iby)
      =
      (ax+iay) (bx-iby)
      (bx+iby) (bx-iby)
      =
      (axbx+ayby) + i(aybx-axby)
      bx2+by2
    and in polar form:
      a / b =
      |a|
      |b|
       , (a - b) >
    and in phasor form:
      a / b =
      |a| ei
      |b| ei
      =
      |a|
      |b|
       ei(-)
     
  • Complex power (real exponent)

    The complex power an (where the exponent is real) is derived in polar form by using DeMoivre's theorem:
      an  = (ax + iay)n
        = (|a| cos  +  i |a| sin )n
        = (|a| (cos  +  i sin ))n
        = |a|n (cos  +  i sin )n
        = |a|n (cos n  +  i sin n)   {from DeMoivre's theorem}
        = |a|n cos n  +  i |a|n sin n
        = < |a|n , n >

    and is derived in phasor form by using Euler's formula:
      an  = (|a| ei)n
        = |a|n ein
        = |a|n (cos n  +  i sin n)
     
  • Complex power (complex exponent)

    The complex power ab (where the exponent is complex) is derived as follows:

    1: Start by expanding ez with Euler's formula:
       e z 
       
        =  
       e (zx + izy) 
       
        =  
       e zx 
       
       e izy 
       
        =  
       e zx 
       
       (cos zy  +   i sin zy)
    2: then apply the following substitutions:
      ab   =   (elog a)b   =   eb log a
      z   =   b log a
      log a   =   log |a| + i a
    Applying these substitutions to create a fully-expanded definition is left as an exercise for the reader.

     
  • Complex exponential

    The complex exponential is derived from Euler's formula:
       e a 
       
        =  
       e (ax + iay) 
       
        =  
       e ax 
       
       e iay 
       
        =  
       e ax 
       
       (cos ay  +   i sin ay)
     
  • Complex natural logarithm

    The complex natural logarithm is defined as:
      log a   =   log (|a| ei)   =   log |a| + log ei   =   log |a| + i a
     
  • Complex trigonometric functions

    The fundamental complex trigonometric functions are defined as:
      sin a
    =
    eia - e-ia
    2i
      cos a
    =
    eia + e-ia
    2
      sinh a
    =
    ea - e-a
    2
      cosh a
    =
    ea + e-a
    2
    The following identities show some important relationships among these functions:
      eia
    = cos a  +  i sin a
      ea
    = cosh a  +  sinh a
      1
    = (cos a)2  +  (sin a)2
      1
    = (cosh a)2  -  (sinh a)2
      i sin a
    = sinh ia
      cos a
    = cosh ia
    The derived complex trigonometric functions are defined as:
      tan a
     =  sin a / cos a
      cot a
     =  1 / tan a
      sec a
     =  1 / cos a
      csc a
     =  1 / sin a
      tanh a
     =  sinh a / cosh a
      coth a
     =  1 / tanh a
      sech a
     =  1 / cosh a
      csch a
     =  1 / sinh a
    Each trigonometric function has a corresponding inverse function.  The name of each inverse function begins with the prefix arc
      sin arcsin a
     =  a
      cos arccos a
     =  a
      tan arctan a
     =  a
      cot arccot a
     =  a
      sec arcsec a
     =  a
      csc arccsc a
     =  a
      sinh arcsinh a
     =  a
      cosh arccosh a
     =  a
      tanh arctanh a
     =  a
      coth arccoth a
     =  a
      sech arcsech a
     =  a
      csch arccsch a
     =  a
     
  • Vector dot product

    The vector dot product (in two dimensions) is defined as:
      a · b = axbx + ayby
    and in polar form:
      a · b = axbx + ayby
      = |a| cos a |b| cos b  +  |a| sin a |b| sin b
      = |a| |b| (cos a cos b  +  sin a sin b)
      = |a| |b| cos (b - a)
      = |a| |b| cos a,b
    where a,b is the angle between the line segment from (0,0) to a and the line segment from (0,0) to b, as measured counter-clockwise from a to b in radians.

     
  • Vector cross product

    The vector cross product (in two dimensions) is defined as the determinant of the coordinate matrix:
      a × b =
       ax ay 
       bx by 
      = axby - aybx
    and in polar form:
      a × b = axby - aybx
      = |a| cos a |b| sin b  -  |a| sin a |b| cos b
      = |a| |b| (cos a sin b  -  sin a cos b)
      = |a| |b| sin (b - a)
      = |a| |b| sin a,b
    where a,b is the angle between the line segment from (0,0) to a and the line segment from (0,0) to b, as measured counter-clockwise from a to b in radians.

    The value |a × b| is the area of the parallelogram defined by the vertices (0,0), a, b, and a+b.

     
  • 2×2 matrix multiplication

    2×2 matrix multiplication with a 2-dimensional vector is defined as:
      ax ay
      bx by
       c 
    = (a · c , b · c) = (axcx + aycy , bxcx + bycy)
    and in polar form:
      ax ay
      bx by
       c 
    = (a · c , b · c) = (|a| |c| cos a,c , |b| |c| cos b,c)
    It's generally easier to develop a geometric understanding of this function for the case where b is perpendicular to a.  In this case, the resulting vector's components are based on the cosine and sine of the same angle -- which simplifies the geometric analysis.  One useful example of this is the following matrix, which emulates complex multiplication by z:
      zx -zy
      zy  zx
       c 
    = (zxcx - zycy , zxcy + zycx)
       
    = (|z| |c| cos (z + c) , |z| |c| sin (z + c))
       
    = < |z| |c| , z + c >
    This matrix is often rewritten using polar coordinates for z:
      zx -zy
      zy  zx
       c 
    =
     
    |z| cos z   -|z| sin z
    |z| sin z    |z| cos z
       c 
    The inverse function (which emulates complex division by z) is:
       |z|-2 zx      |z|-2 zy
      -|z|-2 zy      |z|-2 zx
       c 
    =
     
     |z|-1 cos z    |z|-1 sin z
    -|z|-1 sin z    |z|-1 cos z
       c 
    These functions are useful because they scale and rotate the vector c without introducing any other distortion.  Conceptually, they translate c to and from an alternative coordinate system that uses z as its unit basis.

     
  • Summary of trigonometric forms

    The following table summarizes the trigonometric forms used in the complex functions and 2-dimensional vector functions.  These trigonometric forms are the key to developing a geometric interpretation for each of these functions.

    Function Component Expansion Trigonometric form
    Vector products: a · b = axbx + ayby = |a| |b| cos (b - a)
    a × b = axby - aybx = |a| |b| sin (b - a)
    Matrix multiplication: 
    ax ay
    bx by
     c 
    a · c = axcx + aycy = |a| |c| cos (c - a)
    b · c = bxcx + bycy = |b| |c| cos (c - b)
    Complex multiplication: Re(a * b) = axbx - ayby = |a| |b| cos (a + b)
    Im(a * b) = axby + aybx = |a| |b| sin (a + b)
    Complex division:  Re(a / b) = (axbx + ayby) |b|-2 = |a| |b|-1 cos (a - b)
    Im(a / b) = (aybx - axby) |b|-2 = |a| |b|-1 sin (a - b)
    Complex power: Re(an)     = |a|n cos na
    Im(an)     = |a|n sin na
    Complex exponential: Re(ea)     = eax cos ay
    Im(ea)     = eax sin ay


  •  
    Version history
    1.0 July 2000 Initial release.
    1.1 June 2001 Improved evaluation engine.



    This document and its accompanying software are donated to the public, and can be used with no restrictions.