public final class RadMath extends Object
Modifier and Type | Field and Description |
---|---|
static double |
DEG_TO_RAD_FACTOR
Holds a value that represents the conversion factor for
converting degrees to radians.
|
static double |
EPSILON
Holds the value of
epsilon . |
static double |
RAD_TO_DEG_FACTOR
Holds a value that represents the conversion factor for
converting radians to degrees.
|
Modifier and Type | Method and Description |
---|---|
static boolean |
areClose(double value1,
double value2)
Determines whether the two provided
Double values are close. |
static boolean |
areClose(double value1,
double value2,
double tolerance)
Determines whether the two provided
Double values are close in
the terms of the specified tolerance. |
static RadPoint |
getArcPoint(double angle,
RadPoint center,
double radius)
Calculates the
RadPoint that lies on the arc segment of the ellipse, described by the center and radius parameters. |
static double |
getPointDistance(double x1,
double x2,
double y1,
double y2)
Calculates the distance between two points specified by the provided coordinates.
|
static RadPolarCoordinates |
getPolarCoordinates(RadPoint arcPoint,
RadPoint center)
Calculates the polar coordinates (radius and angle) from the given
RadPoint , part of
an arc with a specified center. |
static RadSize |
getRotatedSize(RadSize size,
double radians)
Calculates a new size (bounds) based on the provided one by rotating it
with the specified angle in radians.
|
static boolean |
isOne(double value)
Calculates whether the provided
Double value is ONE. |
static boolean |
isZero(double value)
Calculates whether the provided
Double value is ZERO. |
public static final double DEG_TO_RAD_FACTOR
public static final double RAD_TO_DEG_FACTOR
public static final double EPSILON
epsilon
.public static boolean isZero(double value)
Double
value is ZERO.value
- the value to check.true
if the value is ZERO, otherwise false
.public static boolean isOne(double value)
Double
value is ONE.value
- the value to check.true
if the value is ONE, otherwise false
.public static boolean areClose(double value1, double value2)
Double
values are close.value1
- the first value.value2
- the second value.true
if the values are close, otherwise false
.public static boolean areClose(double value1, double value2, double tolerance)
Double
values are close in
the terms of the specified tolerance.value1
- the first value.value2
- the second value.tolerance
- the tolerance.true
if the values are close, otherwise false
.public static double getPointDistance(double x1, double x2, double y1, double y2)
x1
- the X coordinate of the first point.x2
- the X coordinate of the second point.y1
- the Y coordinate of the first point.y2
- the Y coordinate of the second point.public static RadPoint getArcPoint(double angle, RadPoint center, double radius)
RadPoint
that lies on the arc segment of the ellipse, described by the center and radius parameters.public static RadPolarCoordinates getPolarCoordinates(RadPoint arcPoint, RadPoint center)
RadPoint
, part of
an arc with a specified center.arcPoint
- an instance of the RadPoint
class depicting the point which polar coordinates should be calculated.center
- an instance of the RadPoint
class depicting the center of the arc on which the point resides.RadPolarCoordinates
class representing the polar coordinates of the point.