Class wave

java.lang.Object
  |
  +--wave

public class wave
extends java.lang.Object

This class represents a single wave in the wave packet simulator.

Stuart Lynn (Summer 2002) and Owain Kenway (Summer 2003)
The School of Physics at the University of Edinburgh.

Questions or problems should be sent to s.lynn@sms.ed.ac.uk or o.a.kenway@sms.ed.ac.uk.


Constructor Summary
wave(double waveno, double amp, boolean vis)
          This is the only constructor for this class.
 
Method Summary
 void drawMe(java.awt.Graphics g, double t, int base, int sizeX, int sizeY)
          Method to draw this wave onto a given graphics context at a specific time.
 double getAmp()
          Method to return the amplitude.
 double getFreq()
          Method to return the frequency.
 double getValue(double x, double t)
          Method to get the value at a given (x,t) co-ordinate.
 double getWaveno()
          Method to return the wavenumber.
 void setColor(java.awt.Color c)
          Method to set colour of wave.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

wave

public wave(double waveno,
            double amp,
            boolean vis)
This is the only constructor for this class. It takes the wave number, the amplitude and whether or not the wave is visible or not.

Parameters:
waveno - the wave number.
amp - the amplitude.
vis - whether the wave is visible or not.
Method Detail

getFreq

public double getFreq()
Method to return the frequency.


getWaveno

public double getWaveno()
Method to return the wavenumber.


getAmp

public double getAmp()
Method to return the amplitude.


setColor

public void setColor(java.awt.Color c)
Method to set colour of wave.

Parameters:
c - the colour to set it to.

getValue

public double getValue(double x,
                       double t)
Method to get the value at a given (x,t) co-ordinate.

Parameters:
x - the x co-ordinate.
t - the time co-ordinate.

drawMe

public void drawMe(java.awt.Graphics g,
                   double t,
                   int base,
                   int sizeX,
                   int sizeY)
Method to draw this wave onto a given graphics context at a specific time.

Parameters:
g - the graphics context to draw the wave onto.
t - the time to draw it at.
base - the base.
sizeX - the size of the graphics area in the x direction.
sizeY - the size of the Y direction.