vec_math
Class Phasing

java.lang.Object
  extended by vec_math.Phasing
All Implemented Interfaces:
VariableDepending
Direct Known Subclasses:
Phasing.PhaseFunction, Phasing.PhaseMultidimensional

public abstract class Phasing
extends Object
implements VariableDepending

Calculates the phase out of the argument. To work also with vectors, we include a multidimensional version, which only means that we act on a single component of the argument vector. We are invertable in a sense that we can recover the argument within one period.


Nested Class Summary
static class Phasing.PhaseFunction
          This is the function version of it.
static class Phasing.PhaseMultidimensional
          The multidimensional version of it, only implemented to work for one-dimensional vectors.
 
Field Summary
static String FREQUENCY
          The name of the cycles per day variable.
private  int index
          Act on this index, if issued with a VectorG.
private  Variable period
          The parameter we depend on is the period.
static String PERIOD
          The name of the period variable.
private  Variable t0
          If we have this, we can also do shifting.
static String T0
          The name of the period variable.
 
Constructor Summary
protected Phasing()
          We act on the zero'th index.
 
Method Summary
protected  double dephase(double phi)
          We invert the function by returning the argument times the period.
protected  double phase(double t)
          We evaluate the function by calculating the phase.
 boolean setVariable(Variable to)
          If the name of the variable assigned here is PERIOD, we register the variable and return true.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PERIOD

public static final String PERIOD
The name of the period variable.

See Also:
Constant Field Values

T0

public static final String T0
The name of the period variable.

See Also:
Constant Field Values

FREQUENCY

public static final String FREQUENCY
The name of the cycles per day variable.

See Also:
Constant Field Values

index

private int index
Act on this index, if issued with a VectorG.


period

private Variable period
The parameter we depend on is the period.


t0

private Variable t0
If we have this, we can also do shifting.

Constructor Detail

Phasing

protected Phasing()
We act on the zero'th index. Only after registering the period, we can deliver correct values.

Method Detail

setVariable

public boolean setVariable(Variable to)
If the name of the variable assigned here is PERIOD, we register the variable and return true.

Specified by:
setVariable in interface VariableDepending

phase

protected double phase(double t)
We evaluate the function by calculating the phase. If no period has been set, we return the argument.


dephase

protected double dephase(double phi)
We invert the function by returning the argument times the period.