org.opensourcephysics.display2d
Class ComplexColorMapper

java.lang.Object
  extended byorg.opensourcephysics.display2d.ComplexColorMapper

public class ComplexColorMapper
extends java.lang.Object


Constructor Summary
ComplexColorMapper(double _ceil)
           
 
Method Summary
 java.awt.Color complexToColor(double re, double im)
          Converts a complex number to hue, saturation, and brightness.
 double getCeil()
          Gets the ceiling color.
 java.awt.Color getCeilColor()
          Gets the ceiling color.
 java.awt.Color phaseToColor(double phi)
          Converts a phase angle in the range [-Pi,Pi] to hue, saturation, and brightness.
 java.awt.Color pointToColor(double[] vertex)
          Converts a vertex point array of samples to hue, saturation, and brightness.
 java.awt.Color samplesToColor(double[] samples)
          Converts an array of samples to hue, saturation, and brightness.
 byte[] samplesToComponents(double[] samples, byte[] rgb)
          Converts a double to color components.
 void setCeilColor(java.awt.Color _ceilColor)
          Sets the ceiling.
 void setScale(double _ceil)
          Sets the z scale.
 javax.swing.JFrame showLegend()
          Shows the phase legend.
static javax.swing.JFrame showPhaseLegend()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComplexColorMapper

public ComplexColorMapper(double _ceil)
Method Detail

showPhaseLegend

public static javax.swing.JFrame showPhaseLegend()

showLegend

public javax.swing.JFrame showLegend()
Shows the phase legend.


setScale

public void setScale(double _ceil)
Sets the z scale.

Parameters:
_ceil -

samplesToComponents

public byte[] samplesToComponents(double[] samples,
                                  byte[] rgb)
Converts a double to color components.

Parameters:
samples - double[]
rgb - byte[]
Returns:
byte[]

phaseToColor

public java.awt.Color phaseToColor(double phi)
Converts a phase angle in the range [-Pi,Pi] to hue, saturation, and brightness.

Parameters:
phi - phase angle
Returns:
the HSB color

complexToColor

public java.awt.Color complexToColor(double re,
                                     double im)
Converts a complex number to hue, saturation, and brightness.

Parameters:
re -
im -
Returns:
the HSB color

samplesToColor

public java.awt.Color samplesToColor(double[] samples)
Converts an array of samples to hue, saturation, and brightness. Samples contains magnitude, re, and im.

Parameters:
samples -
Returns:
the HSB color

pointToColor

public java.awt.Color pointToColor(double[] vertex)
Converts a vertex point array of samples to hue, saturation, and brightness. A vertex containing x, y, magnitude, re, and im.

Parameters:
vertex - the point
Returns:
the HSB color

getCeil

public double getCeil()
Gets the ceiling color.

Returns:

getCeilColor

public java.awt.Color getCeilColor()
Gets the ceiling color.

Returns:

setCeilColor

public void setCeilColor(java.awt.Color _ceilColor)
Sets the ceiling.

Parameters:
_ceilColor -