com.dopanic.panicsensorkit
Class PSKMath

java.lang.Object
  extended by com.dopanic.panicsensorkit.PSKMath

public class PSKMath
extends java.lang.Object


Field Summary
static double DEGREES_TO_RADIANS
           
static float DEGREES_TO_RADIANS_FLOAT
           
static float[] identityMatrix4x4
           
static double RADIANS_TO_DEGREES
           
static float RADIANS_TO_DEGREES_FLOAT
           
static double WGS84_A
           
static double WGS84_E
           
 
Constructor Summary
PSKMath()
           
 
Method Summary
static float clampf(float v, float min, float max)
          Center around a value
static float deltaAngle(float a, float b)
           
static double drepeat(double value, double max)
           
static float Feet2Meter(float feet)
           
static float frepeat(float value, float max)
           
static double Km2Mile(double _d)
           
static float Km2Mile(float _d)
           
static double lerp(double a, double b, double t)
          linear interpolation
static double lerpAngle(double a, double b, double f)
           
static float lerpAnglef(float a, float b, float f)
           
static float lerpf(float a, float b, float t)
           
static double lincos(double angle)
           
static float lincos(float angle)
           
static double linsin(double angle)
           
static float linsin(float angle)
           
static float[] lowPass(float[] newValues, float[] previousValues, float alpha)
          low-pass filter array of floats
static float lowPass(float newValue, float previousValue, float alpha)
          low-pass float
static float Meter2Feet(float meters)
           
static float Mile2Km(float miles)
           
static float Mile2Meters(float miles)
           
static float[] PSKAtittudePitchCoordinates(float[] vectorV, float[] vectorG)
           
static PSKVector3 PSKConvertLatLonToEcef(double lat, double lon, double alt)
           
static PSKVector3Double PSKEcefToEnu(double latPoi, double lonPoi, PSKVector3 ecefDevice, PSKVector3 poiECEF)
           
static PSKVector3 PSKMatrix3x3MultiplyWithVector3(float[] m, PSKVector3 v)
          Multiply 3x3 (or in fact any matrix >= that..) with a PSK3Vector
static double[] PSKMatrix4x4MultiplyWithMatrix4x4(double[] a, double[] b)
           
static double[] PSKMatrix4x4MultiplyWithVector4(float[] m, double[] v)
           
static float[] PSKMatrixCreateProjection(double fovy, float aspect, float zNear, float zFar)
           
static float[] PSKMatrixFastMultiplyWithMatrix(float[] m1, float[] m2)
          "Fast" is exaggerated..
static void PSKMatrixSetYRotationUsingDegrees(float[] mout, float degrees)
           
static void PSKMatrixSetYRotationUsingRadians(float[] mout, float rad)
           
static float[] PSKRadarCoordinatesFromVectorWithGravity(float[] v, float[] g)
           
static float PSKVector4Angle(float[] vec)
           
static double relativeAngle(double angle)
           
static float relativeAngle(float angle)
           
static int repeat(int value, int max)
           
static PointF RotatedPointAboutOrigin(float x, float y, float sin, float cos)
           
static double sign(double n)
           
static float signf(float n)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEGREES_TO_RADIANS

public static final double DEGREES_TO_RADIANS
See Also:
Constant Field Values

RADIANS_TO_DEGREES

public static final double RADIANS_TO_DEGREES
See Also:
Constant Field Values

DEGREES_TO_RADIANS_FLOAT

public static final float DEGREES_TO_RADIANS_FLOAT
See Also:
Constant Field Values

RADIANS_TO_DEGREES_FLOAT

public static final float RADIANS_TO_DEGREES_FLOAT
See Also:
Constant Field Values

identityMatrix4x4

public static final float[] identityMatrix4x4

WGS84_A

public static final double WGS84_A
See Also:
Constant Field Values

WGS84_E

public static final double WGS84_E
See Also:
Constant Field Values
Constructor Detail

PSKMath

public PSKMath()
Method Detail

Mile2Km

public static float Mile2Km(float miles)
Parameters:
miles -
Returns:

Mile2Meters

public static float Mile2Meters(float miles)
Parameters:
miles -
Returns:

Km2Mile

public static double Km2Mile(double _d)
Parameters:
_d -
Returns:

Km2Mile

public static float Km2Mile(float _d)
Parameters:
_d -
Returns:

Feet2Meter

public static float Feet2Meter(float feet)
Parameters:
feet -
Returns:

Meter2Feet

public static float Meter2Feet(float meters)
Parameters:
meters -
Returns:

lerp

public static double lerp(double a,
                          double b,
                          double t)
linear interpolation


lerpf

public static float lerpf(float a,
                          float b,
                          float t)
Parameters:
a -
b -
t -
Returns:

lerpAngle

public static double lerpAngle(double a,
                               double b,
                               double f)
Parameters:
a -
b -
f -
Returns:

lerpAnglef

public static float lerpAnglef(float a,
                               float b,
                               float f)
Parameters:
a -
b -
f -
Returns:

repeat

public static int repeat(int value,
                         int max)
Parameters:
value -
max -
Returns:

frepeat

public static float frepeat(float value,
                            float max)
Parameters:
value -
max -
Returns:

drepeat

public static double drepeat(double value,
                             double max)
Parameters:
value -
max -
Returns:

signf

public static float signf(float n)
Parameters:
n -
Returns:

sign

public static double sign(double n)
Parameters:
n -
Returns:

relativeAngle

public static float relativeAngle(float angle)
Parameters:
angle -
Returns:

relativeAngle

public static double relativeAngle(double angle)
Parameters:
angle -
Returns:

linsin

public static float linsin(float angle)
Parameters:
angle -
Returns:

linsin

public static double linsin(double angle)
Parameters:
angle -
Returns:

lincos

public static float lincos(float angle)
Parameters:
angle -
Returns:

lincos

public static double lincos(double angle)
Parameters:
angle -
Returns:

deltaAngle

public static float deltaAngle(float a,
                               float b)
Parameters:
a -
b -
Returns:

clampf

public static float clampf(float v,
                           float min,
                           float max)
Center around a value

Parameters:
v -
min -
max -
Returns:

PSKConvertLatLonToEcef

public static PSKVector3 PSKConvertLatLonToEcef(double lat,
                                                double lon,
                                                double alt)

PSKEcefToEnu

public static PSKVector3Double PSKEcefToEnu(double latPoi,
                                            double lonPoi,
                                            PSKVector3 ecefDevice,
                                            PSKVector3 poiECEF)

PSKMatrix4x4MultiplyWithVector4

public static double[] PSKMatrix4x4MultiplyWithVector4(float[] m,
                                                       double[] v)

PSKMatrixSetYRotationUsingRadians

public static void PSKMatrixSetYRotationUsingRadians(float[] mout,
                                                     float rad)

PSKMatrixSetYRotationUsingDegrees

public static void PSKMatrixSetYRotationUsingDegrees(float[] mout,
                                                     float degrees)

PSKVector4Angle

public static float PSKVector4Angle(float[] vec)

PSKRadarCoordinatesFromVectorWithGravity

public static float[] PSKRadarCoordinatesFromVectorWithGravity(float[] v,
                                                               float[] g)

PSKMatrixFastMultiplyWithMatrix

public static float[] PSKMatrixFastMultiplyWithMatrix(float[] m1,
                                                      float[] m2)
"Fast" is exaggerated..

Parameters:
m1 -
m2 -

PSKAtittudePitchCoordinates

public static float[] PSKAtittudePitchCoordinates(float[] vectorV,
                                                  float[] vectorG)

RotatedPointAboutOrigin

public static PointF RotatedPointAboutOrigin(float x,
                                             float y,
                                             float sin,
                                             float cos)

PSKMatrix4x4MultiplyWithMatrix4x4

public static double[] PSKMatrix4x4MultiplyWithMatrix4x4(double[] a,
                                                         double[] b)

PSKMatrixCreateProjection

public static float[] PSKMatrixCreateProjection(double fovy,
                                                float aspect,
                                                float zNear,
                                                float zFar)

PSKMatrix3x3MultiplyWithVector3

public static PSKVector3 PSKMatrix3x3MultiplyWithVector3(float[] m,
                                                         PSKVector3 v)
Multiply 3x3 (or in fact any matrix >= that..) with a PSK3Vector

Parameters:
m - Matrix
v - Input vector

lowPass

public static float[] lowPass(float[] newValues,
                              float[] previousValues,
                              float alpha)
low-pass filter array of floats

Parameters:
newValues - new values for array
previousValues - old values
alpha - the filter amount

lowPass

public static float lowPass(float newValue,
                            float previousValue,
                            float alpha)
low-pass float

Parameters:
newValue - new value
previousValue - old value
alpha - the filter amount



Copyright © 2014 doPanic GmbH. All rights reserved.