public class MathUtils
extends java.lang.Object
Title: MathUtils class
Description:
Copyright (c) 2005-2019 by Steema Software SL. All Rights Reserved.
Company: Steema Software SL
Modifier and Type | Field and Description |
---|---|
static double |
PISTEP |
Constructor and Description |
---|
MathUtils() |
Modifier and Type | Method and Description |
---|---|
static double |
atan2(double y,
double x)
Note: This method has been implemented here in MathUtils class
because J2ME Math class does not include it.
|
static double |
calcDistance(Point p,
int x0,
int y0,
int x1,
int y1) |
static Point |
calcPoint(double angle,
Point center,
double radiusX,
double radiusY) |
static int |
compareDoubles(double d1,
double d2)
Note: This code has been copied from Java JDK Double.compare method,
because J2ME Double class does not include it.
|
static double |
exp(double a)
Note: This method has been implemented here in MathUtils class
because J2ME Math class does not include it.
|
static double |
log(double value)
Note: This function has been added to MathUtils because J2ME Math
class does not include it.
|
static double |
log(double x,
double numBase) |
static Point |
pointAtDistance(Point aFrom,
Point aTo,
int aDist) |
static boolean |
pointInLineTolerance(Point p,
int x0,
int y0,
int x1,
int y1,
int tolerance) |
static double |
pow(double a,
double b)
Note: This method has been implemented here in MathUtils class
because J2ME Math class does not include it.
|
static int |
round(double value)
Returns the integer nearest to "value" parameter
|
static double |
sqr(double x) |
static double |
trunc(double d)
Note: This method has been implemented here in MathUtils class
because J2ME Math class does not include it.
|
public static final double PISTEP
public static final double sqr(double x)
public static double log(double value)
value
- doublepublic static double log(double x, double numBase)
public static int round(double value)
value
- doublepublic static double calcDistance(Point p, int x0, int y0, int x1, int y1)
public static boolean pointInLineTolerance(Point p, int x0, int y0, int x1, int y1, int tolerance)
public static int compareDoubles(double d1, double d2)
d1
- doubled2
- doublepublic static double atan2(double y, double x)
y
- doublex
- doublepublic static double pow(double a, double b)
a
- doubleb
- doublepublic static double exp(double a)
a
- doublepublic static double trunc(double d)
d
- double