gov.noaa.pmel.sgt
Class LinearTransform

java.lang.Object
  extended by gov.noaa.pmel.sgt.AxisTransform
      extended by gov.noaa.pmel.sgt.LinearTransform
All Implemented Interfaces:
Transform, java.io.Serializable, java.lang.Cloneable

public class LinearTransform
extends AxisTransform
implements java.lang.Cloneable

Performs a linear transformation on cartesian axes. If the transformtion is for space the equation is phys = a*user + b and if time is phys = at*time + bt.

Since:
1.0
Version:
$Revision$, $Date$
Author:
Donald Denbo
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.noaa.pmel.sgt.AxisTransform
changes_, ident_, p1_, p2_, space_, t1_, t2_, u1_, u2_
 
Constructor Summary
LinearTransform()
          Default constructor.
LinearTransform(double p1, double p2, double u1, double u2)
          LinearTransform constructor.
LinearTransform(double p1, double p2, GeoDate t1, GeoDate t2)
          LinearTransform constructor.
LinearTransform(Range2D pr, Range2D ur)
          LinearTransform constructor.
LinearTransform(Range2D pr, SoTRange str)
          LinearTransform constructor.
LinearTransform(Range2D pr, TimeRange tr)
          LinearTransform constructor.
 
Method Summary
 AxisTransform copy()
          Create a copy of the LinearTransform.
 long getLongTimeTransU(double p)
          Transform from physical coordinates to long representation of time.
 SoTValue getSoTTransU(double p)
          Get user transform value as a SoTValue
 GeoDate getTimeTransU(double p)
          Transform from physical coordinates to time.
 double getTransP(double u)
          Transform from user to physical coordinates.
 double getTransP(GeoDate t)
          Transform from time to physical coordinates.
 double getTransP(long t)
          Transform from long representation of time to physical coordinates.
 double getTransP(SoTValue v)
          Get physical value as a function of SoTValue.
 double getTransU(double p)
          Transform from physical to user coordinates.
 java.lang.String toString()
           
 
Methods inherited from class gov.noaa.pmel.sgt.AxisTransform
addPropertyChangeListener, getId, getRangeP, getRangeU, getSoTRangeU, getTimeRangeU, isSpace, isTime, removePropertyChangeListener, setId, setRangeP, setRangeP, setRangeU, setRangeU, setRangeU, setRangeU, setRangeU, setRangeU
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearTransform

public LinearTransform()
Default constructor. Creates a transform with arguments Transform(0.0, 1.0, 0.0, 1.0).


LinearTransform

public LinearTransform(double p1,
                       double p2,
                       double u1,
                       double u2)
LinearTransform constructor. This constructor is used to define transforms that use double user values.

Parameters:
p1 - minimum value, physical coordinates
p2 - maximum value, physical coordinates
u1 - minimum value, user coordinates
u2 - maximum value, user coordinates

LinearTransform

public LinearTransform(Range2D pr,
                       Range2D ur)
LinearTransform constructor. This constructor is used to define transforms that use double user values.

Parameters:
pr - physical coordinate range
ur - user coordinate range
See Also:
Range2D

LinearTransform

public LinearTransform(double p1,
                       double p2,
                       GeoDate t1,
                       GeoDate t2)
LinearTransform constructor. This constructor is used to define transforms that use GeoDate user values.

Parameters:
p1 - minimum value, physical coordinates
p2 - maximum value, physical coordinates
t1 - minimum time
t2 - maximum time
See Also:
GeoDate

LinearTransform

public LinearTransform(Range2D pr,
                       TimeRange tr)
LinearTransform constructor. This constructor is used to define transforms that use GeoDate user values.

Parameters:
pr - physical coordinates range
tr - time range
See Also:
Range2D, TimeRange, GeoDate

LinearTransform

public LinearTransform(Range2D pr,
                       SoTRange str)
LinearTransform constructor. This constructor is used to define transforms that use SoTRange user values.

Parameters:
pr - physical coordinates range
str - space or time range
Since:
2.0
See Also:
SoTRange, Range2D
Method Detail

getTransP

public double getTransP(double u)
Transform from user to physical coordinates.

Specified by:
getTransP in interface Transform
Parameters:
u - user value
Returns:
physical value

copy

public AxisTransform copy()
Create a copy of the LinearTransform.

Returns:
the copy

getTransP

public double getTransP(GeoDate t)
Transform from time to physical coordinates.

Parameters:
t - time
Returns:
user value

getTransP

public double getTransP(SoTValue v)
Description copied from class: AxisTransform
Get physical value as a function of SoTValue.

Specified by:
getTransP in class AxisTransform

getTransP

public double getTransP(long t)
Transform from long representation of time to physical coordinates.

Since:
3.0

getTransU

public double getTransU(double p)
Transform from physical to user coordinates.

Specified by:
getTransU in interface Transform
Parameters:
p - physical value
Returns:
user value

getTimeTransU

public GeoDate getTimeTransU(double p)
Transform from physical coordinates to time.

Parameters:
p - physical value
Returns:
time value

getLongTimeTransU

public long getLongTimeTransU(double p)
Transform from physical coordinates to long representation of time.

Parameters:
p - physical value
Returns:
milliseconds since 1970-01-01
Since:
3.0

getSoTTransU

public SoTValue getSoTTransU(double p)
Description copied from class: AxisTransform
Get user transform value as a SoTValue

Specified by:
getSoTTransU in class AxisTransform

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object