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
-
CompGraph()
- Default Constructor
-
getView()
- Get current view.
-
getxmax()
- Get maximum Re(z) for domain.
-
getxmin()
- Get minimum Re(z) for domain.
-
getymax()
- Get maximum Im(z) for domain.
-
getymin()
- Get minimum Im(z) for domain.
-
getzauto()
- Get flag for automatic vertical scaling.
-
getzmax()
- Get maximum |f(z) for the display box.
-
getzmin()
- Get minimum |f(z)| for the display box.
-
paint(Graphics)
- Paints the CompGraph on the screen.
-
setLimits(double, double, double, double)
- Set new domain.
-
setView(String)
- Set the view for the graph.
-
setfct(String)
- Set a new function for graph
Creates a new Functionz object to be graphed.
-
setzLimits(double, double)
- Set new limits for |f(z)| for the display box.
-
setzauto(boolean)
- Set flag for automatic vertical scaling.
CompGraph
public CompGraph()
- Default Constructor
getView
public java.lang.String getView()
- Get current view.
- Returns:
- "side" or "top".
getxmax
public double getxmax()
- Get maximum Re(z) for domain.
- Returns:
- max Re(z).
getxmin
public double getxmin()
- Get minimum Re(z) for domain.
- Returns:
- min Re(z).
getymax
public double getymax()
- Get maximum Im(z) for domain.
- Returns:
- max Im(z).
getymin
public double getymin()
- Get minimum Im(z) for domain.
- Returns:
- min Im(z).
getzauto
public boolean getzauto()
- Get flag for automatic vertical scaling.
- Returns:
- true if automatical vertical scaling in effect.
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.
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 .
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
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).
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).
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.
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.
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