

PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 
java.lang.Object uk.ac.starlink.ast.Transformer uk.ac.starlink.ast.Transformer2
public abstract class Transformer2
Defines a custom twodimensional coordinate transformation function.
This abstract subclass of Transformer
is provided for
convenience when only a 2d transformation is required. Subclasses
need to implement the tran2
method, which is somewhat more
convenient than Transformer
's tranP
method.
Constructor Summary  

Transformer2()

Method Summary  

boolean 
canTransformCoords(int nin,
int nout)
Indicates whether this Transformer
is able to transform between coordinate spaces with the given
dimensionalities. 
abstract double[][] 
tran2(int npoint,
double[] xin,
double[] yin,
boolean forward)
Transforms points from 2d input coordinates to 2d output coordinates. 
double[][] 
tranP(int npoint,
int ncoord_in,
double[][] in,
boolean forward,
int ncoord_out)
Transforms points from input coordinates to output coordinates. 
Methods inherited from class uk.ac.starlink.ast.Transformer 

getAuthor, getContact, getPurpose, hasForward, hasInverse, simpFI, simpIF 
Methods inherited from class java.lang.Object 

clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait 
Constructor Detail 

public Transformer2()
Method Detail 

public final boolean canTransformCoords(int nin, int nout)
Transformer
is able to transform between coordinate spaces with the given
dimensionalities.
canTransformCoords
in class Transformer
nin
 the number of coordinates of an input pointnout
 the number of coordinates of an output point
nin
and nout
are equal to 2public final double[][] tranP(int npoint, int ncoord_in, double[][] in, boolean forward, int ncoord_out) throws Exception
Transformer
Transformer
,
taking an array of input coordinate arrays and returning
an array of output coordinate arrays.
This method will only be called with forward
set true
if a prior call of the hasForward
method has returned
true, and will only be called with forward
set false
if a prior call of the hasInverse
has returned true.
If forward
is true, then this method will only be called
with values of ncoord_in
, ncoord_out
for which a prior call of canTransform(ncoord_in,ncoord_out)
has returned true.
If forward
is false, then this method will only be called
with values of ncoord_in
, ncoord_out
for which a prior call of canTransform(ncoord_out,ncoord_in)
has returned true.
tranP
in class Transformer
npoint
 the number of points to be transformedncoord_in
 the number of coordinates being supplied
for each input point (the dimensionality of
the input space)in
 an array of ncoord_in
arrays,
each containing npoint
elements.
These give the coordinates of each point to
transform.forward
 true
if the forward transformation
is to be used, false
if its inverse
transformation is to be usedncoord_out
 the number of coordinates being generated
by the transformation for each output point
(the dimensionality of the output space).
This need not be equal to ncoord_in
.
ncoord_out
arrays,
each containing npoint
elements.
These give the coordinates of the transformed
points.
throws Exception If an error occurs during the transformation,
this method may throw an Exception. In this
case the transformation will be aborted.
Exception
public abstract double[][] tran2(int npoint, double[] xin, double[] yin, boolean forward) throws Exception
Transformer2
,
taking input x and y coordinate arrays and returning a twoelement
array consisting of the x and y output coordinate arrays.
This method will only be called with forward
set true
if a prior call of the hasForward
method has returned
true, and will only be called with forward
set false
if a prior call of the hasInverse
has returned true.
npoint
 the number of points to be transformedxin
 an array of npoint
elements
representing the X coordinates to be transformedyin
 an array of npoint
elements
representing the Y coordinates to be transformedforward
 true
if the forward transformation
is to be used, false
if its inverse
transformation is to be used
npoint
element array of the output X coordinates,
and the second element is an
npoint
element array of the output Y coordinates
Exception
 If an error occurs during the transformation,
this method may throw an Exception. In this
case the transformation will be aborted.


PREV CLASS NEXT CLASS  FRAMES NO FRAMES  
SUMMARY: NESTED  FIELD  CONSTR  METHOD  DETAIL: FIELD  CONSTR  METHOD 