|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fraid.math.MathHelper
public class MathHelper
Different mathematical routines. All methods are static.
Field Summary | |
---|---|
static java.util.Random |
random
Systemwide random generator. |
protected static int |
smoothing
The parameter which determines how smooth the lagrangeHermite approximation will be arround the sampling points. |
Constructor Summary | |
---|---|
MathHelper()
|
Method Summary | |
---|---|
static Complex[] |
calc(java.util.Vector aFunctions,
Complex[] aArgs,
double aTime)
Calculates the system given by aFunctions at the point aArgs. |
static int |
getSmoothing()
Returns the smoothing value. |
static double |
lagrangeHermite(double aPoint,
double aPX,
double aPY,
double aSX,
double aSY,
double aEX,
double aEY,
double aNX,
double aNY)
Given four points p1,p2,p3,p4 approximates the y-value of a point which is between p2.x and p3.x. |
static int |
log2int(int aValue)
|
static void |
main(java.lang.String[] args)
Test driver for MathHelper |
static int |
nextpow2(double aValue)
|
static int |
pow2length(int aValue)
|
static void |
printComplexArray(Complex[] aArray)
Test function. |
static Complex |
quad(ComplexFunction aFun,
double aLLimit,
double aULimit,
int aPoints)
Test function. |
static void |
rotate3D(DoublePoint3D aInitialPoint,
DoublePoint3D aTransformedPoint,
DoublePoint3D aVectorToRotateAround,
double aRotationAngle,
double aScale)
|
static void |
setSmoothing(int newSmoothing)
Sets the smoothing value. |
static Complex[] |
sumScalVect(double aScalar1,
Complex[] aVect1,
double aScalar2,
Complex[] aVect2)
Performs aScalar1*aVect1 + aScalar2*aVect2 |
static void |
transform(java.util.Vector aFunctions,
Complex[] aArgs,
Complex[] aTransformed)
Transform the n-dimensional point aArgs with the transformation in aFunctions. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.util.Random random
protected static int smoothing
Constructor Detail |
---|
public MathHelper()
Method Detail |
---|
public static int getSmoothing()
smoothing
value.
int
valuepublic static void setSmoothing(int newSmoothing) throws MathException
smoothing
value.
newSmoothing
- an int
value
MathException
- if newSmoothing < 1public static double lagrangeHermite(double aPoint, double aPX, double aPY, double aSX, double aSY, double aEX, double aEY, double aNX, double aNY)
aPoint
- the abscisa of the point we are trying to approximate;aPX
- the point before the first point of the interval (aSX),
needed to calculate the derivative at aSX;aSX
- the first(start) point of the interval;aEX
- the second(end) point of the interval;aNX
- the point after the end of the interval (aEX),
used to calculate the derivative at the end of the interval (aEX);
DoublePoint
public static Complex[] sumScalVect(double aScalar1, Complex[] aVect1, double aScalar2, Complex[] aVect2)
aScalar1
- a double
valueaVect1
- a Complex[]
valueaScalar2
- a double
valueaVect2
- a Complex[]
value
Complex[]
valuepublic static Complex[] calc(java.util.Vector aFunctions, Complex[] aArgs, double aTime) throws java.lang.Exception
aFunctions
- the systemaArgs
- the point at which we need the value calculatedaTime
- optional time variable
java.lang.Exception
- if an error occurspublic static void transform(java.util.Vector aFunctions, Complex[] aArgs, Complex[] aTransformed) throws java.lang.Exception
the
- transformation given by a system of n, n-dimensional equations;the
- point we are transforming;
java.lang.Exception
- if an error occurspublic static void rotate3D(DoublePoint3D aInitialPoint, DoublePoint3D aTransformedPoint, DoublePoint3D aVectorToRotateAround, double aRotationAngle, double aScale)
public static Complex quad(ComplexFunction aFun, double aLLimit, double aULimit, int aPoints) throws java.lang.Exception
aArray
- a Complex[]
value
java.lang.Exception
public static int log2int(int aValue) throws ComplexFunctionException
ComplexFunctionException
public static int nextpow2(double aValue)
public static int pow2length(int aValue)
public static void printComplexArray(Complex[] aArray)
aArray
- a Complex[]
valuepublic static void main(java.lang.String[] args) throws java.lang.Exception
args
- a String[]
value
java.lang.Exception
- if an error occurs
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |