|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjabble.MathUtils
public class MathUtils
A toolkit class containing a set of mathematical functions typically used for initial conditions (gaussian, pulse, step, ...).
| Method Summary | |
|---|---|
static double |
gaussian(double x,
double centerX,
double width)
1D gaussian, centered on centerX and with the specified width. |
static double |
gaussian(double x,
double y,
double centerX,
double centerY,
double width)
2D gaussian, centered on centerX/Y and with the specified width. |
static double |
gaussian(double x,
double y,
double z,
double centerX,
double centerY,
double centerZ,
double width)
3D gaussian, centered on centerX/Y/Z and with the specified width. |
static double |
module(double a,
double b)
Returns the modulus from the two components. |
static double |
module2(double a,
double b)
Returns the modulus square of a complex number given the real and imaginary part. |
static double |
modulus(double... components)
Calculates the modulus given the components of a vector. |
static double |
phase(double a,
double b)
Returns the phase of a complex number given the real and imaginary part. |
static double |
phaseDiff(double theta1,
double theta2)
Returns the difference of the two angles, taking into account periodicity. |
static double |
reverseStep(double x,
double stepX)
Reverse step function, returns 1.0 before stepX and 1.0 afterwards. |
static double |
squarePulse(double x,
double lowerX,
double upperX)
1D pulse, returns 1.0 within the range and 0.0 outside. |
static double |
squarePulse(double x,
double y,
double lowerX,
double upperX,
double lowerY,
double upperY)
2D pulse, returns 1.0 within the range and 0.0 outside. |
static double |
squarePulse(double x,
double y,
double z,
double lowerX,
double upperX,
double lowerY,
double upperY,
double lowerZ,
double upperZ)
3D pulse, returns 1.0 within the range and 0.0 outside. |
static double |
step(double x,
double stepX)
Step funtion, returns 0.0 before stepX and 1.0 afterwards. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static double phase(double a,
double b)
a - real part of a complex numberb - imaginary part of a complex number
public static double module2(double a,
double b)
a - real part of a complex numberb - imaginary part of a complex number
public static double module(double a,
double b)
a - real part of a complex numberb - imaginary part of a complex number
public static double modulus(double... components)
components - the components
public static double phaseDiff(double theta1,
double theta2)
theta1 - an angletheta2 - anothe angle
public static double gaussian(double x,
double y,
double z,
double centerX,
double centerY,
double centerZ,
double width)
x - coordinate xy - coordinate yz - coordinate zcenterX - center of the gaussian on xcenterY - center of the gaussian on ycenterZ - center of the gaussian on zwidth - width of the gaussian in all directions
public static double gaussian(double x,
double y,
double centerX,
double centerY,
double width)
x - coordinate xy - coordinate ycenterX - center of the gaussian on xcenterY - center of the gaussian on ywidth - width of the gaussian in all directions
public static double gaussian(double x,
double centerX,
double width)
x - coordinate xcenterX - center of the gaussian on xwidth - width of the gaussian in all directions
public static double squarePulse(double x,
double lowerX,
double upperX)
x - coordinate xlowerX - lower boundary for the pulseupperX - upper boundary for the pulse
public static double squarePulse(double x,
double y,
double lowerX,
double upperX,
double lowerY,
double upperY)
x - coordinate xy - coordinate ylowerX - lower boundary for the pulse on xupperX - upper boundary for the pulse on xlowerY - lower boundary for the pulse on yupperY - upper boundary for the pulse on y
public static double squarePulse(double x,
double y,
double z,
double lowerX,
double upperX,
double lowerY,
double upperY,
double lowerZ,
double upperZ)
x - coordinate xy - coordinate yz - coordinate zlowerX - lower boundary for the pulse on xupperX - upper boundary for the pulse on xlowerY - lower boundary for the pulse on yupperY - upper boundary for the pulse on ylowerZ - lower boundary for the pulse on zupperZ - upper boundary for the pulse on z
public static double step(double x,
double stepX)
x - coordinate xstepX - value at which the function changes
public static double reverseStep(double x,
double stepX)
x - coordinate xstepX - value at which the function changes
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||