Class CompGraph Complex Function Grapher

Class CompGraph

Object
   |
   +----Component
           |
           +----Canvas
                   |
                   +----CompGraph

public class CompGraph
extends Canvas
CompGraph implements a canvas which graphs a complex function where the modulus is plotted on the vertical axis and the argument is denoted by color. It defines the function with a Functionz object and also uses Complex objects for the complex numbers. Last updated February 26, 2001 (copyright 1997-2001)

Version:
1.0
Author:
Andrew G. Bennett
See Also:
Functionz, Complex

Constructor Index

 o CompGraph()
Default Constructor

Method Index

 o getView()
Get current view.
 o getxmax()
Get maximum Re(z) for domain.
 o getxmin()
Get minimum Re(z) for domain.
 o getymax()
Get maximum Im(z) for domain.
 o getymin()
Get minimum Im(z) for domain.
 o getzauto()
Get flag for automatic vertical scaling.
 o getzmax()
Get maximum |f(z) for the display box.
 o getzmin()
Get minimum |f(z)| for the display box.
 o paint(Graphics)
Paints the CompGraph on the screen.
 o setLimits(double, double, double, double)
Set new domain.
 o setView(String)
Set the view for the graph.
 o setfct(String)
Set a new function for graph
Creates a new Functionz object to be graphed.
 o setzLimits(double, double)
Set new limits for |f(z)| for the display box.
 o setzauto(boolean)
Set flag for automatic vertical scaling.

Constructors

 o CompGraph
public CompGraph()
Default Constructor

Methods

 o getView
public java.lang.String getView()
Get current view.

Returns:
"side" or "top".
 o getxmax
public double getxmax()
Get maximum Re(z) for domain.

Returns:
max Re(z).
 o getxmin
public double getxmin()
Get minimum Re(z) for domain.

Returns:
min Re(z).
 o getymax
public double getymax()
Get maximum Im(z) for domain.

Returns:
max Im(z).
 o getymin
public double getymin()
Get minimum Im(z) for domain.

Returns:
min Im(z).
 o getzauto
public boolean getzauto()
Get flag for automatic vertical scaling.

Returns:
true if automatical vertical scaling in effect.
 o getzmax
public double getzmax()
Get maximum |f(z) for the display box.
Note the maximum |f(z)| for the display box won't necessarily be the maximum |f(z)| over the domain, even if zauto is true so automatic scaling is in effect, since the maximum probably will not be attained at a grid point.

Returns:
max |f(z)| of display box.
 o getzmin
public double getzmin()
Get minimum |f(z)| for the display box.
Note the minimum |f(z)| for the display box won't necessarily be the minimum |f(z)| over the domain, even if zauto is true so automatic scaling is in effect, since the minimum probably will not be attained at a grid point.

Returns:
min |f(z)| of display box .
 o paint
public void paint(Graphics g)
Paints the CompGraph on the screen.
This method must be called to update the screen after any changes are made to the graph. Usually invoked indirectly through a call to repaint().

Overrides:
paint in class Canvas
 o setLimits
public void setLimits(double rmin,
                      double rmax,
                      double imin,
                      double imax)
Set new domain.
This will change the base rectangle for the display box. The changes will not be visible until this component is repainted.

Parameters:
rmin - minimum Re(z).
rmax - maximum Re(z).
imin - minimum Im(z).
imax - maximum Im(z).
 o setView
public void setView(String s)
Set the view for the graph.
Chooses whether graph is viewed from the side, showing both |f(z)| on vertical axis and arg(f(z)) with color, or viewed from the top so only the color is visible. Changes won't be visible until this component is repainted.

Parameters:
s - "top" for top view (otherwise defaults to side view).
 o setfct
public void setfct(String s)
Set a new function for graph
Creates a new Functionz object to be graphed. Note that this method doesn't change the display, so the changes won't be visible until this component is repainted.

Parameters:
s - formula for the Functionz to be graphed.
 o setzLimits
public void setzLimits(double min,
                       double max)
Set new limits for |f(z)| for the display box.
Sets new minimum and maximum values for |f(z)|, the vertical axis of the display box. Note that no changes will be visible until this component is repainted.

Parameters:
min - minimum |f(z)| of display box.
max - maximum |f(z)| of display box.
 o setzauto
public void setzauto(boolean flag)
Set flag for automatic vertical scaling.

Parameters:
flag - true for automatic scaling, false to set limits manually


Please report any problems with this page to bennett@math.ksu.edu