public class AreaUtilities
extends java.lang.Object
Constructor and Description |
---|
AreaUtilities() |
Modifier and Type | Method and Description |
---|---|
static double |
calcCircleArea(double r)
Computes the area of a circle using the most popular algorithm pies are squared
|
static double |
calcRectArea(double h,
double w)
Computes the area of a rectangle using the most popular algorithm hxw
|
static double |
calcShapeArea(GeoPoint[] points)
Computes the area of a list of points assuming to be closed and also assume to be in order.
|
static double |
convertValue(double value,
Area from,
Area to)
Method to convert a value from an area type to another area type
|
static java.lang.String |
formatArea(int unitsType,
double value,
Area units)
Given a unit type and a value with the provided area units will produce the appropriate
string.
|
static void |
setFeetToMileThreshold(int value)
Sets the threshold used, that when reached that when calls to SpanUtilities will switch
from return feet to miles.
|
static void |
setMetersToKilometersThreshold(int value)
Sets the threshold used, that when reached that when calls to SpanUtilities will switch
from return meters to kilometers.
|
public static void setFeetToMileThreshold(int value)
public static void setMetersToKilometersThreshold(int value)
public static java.lang.String formatArea(int unitsType, double value, Area units)
unitsType
- the unit types preferred for display. ENGLISH, METRIC, NM, ACvalue
- the value to useunits
- the units that the value is in.public static double convertValue(double value, Area from, Area to)
value
- raw value in the format described by the from valuefrom
- the Area of the source valueto
- the value to convert to.public static double calcShapeArea(GeoPoint[] points)
points
- the list of points.public static double calcRectArea(double h, double w)
h
- heightw
- widthpublic static double calcCircleArea(double r)
r
- radius