|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgov.nasa.worldwind.util.WWMath
public class WWMath
A collection of useful math methods, all static.
| Constructor Summary | |
|---|---|
WWMath()
|
|
| Method Summary | |
|---|---|
static double |
clamp(double v,
double min,
double max)
Clamps a value to a given range. |
static double |
convertMetersToFeet(double meters)
converts meters to feet. |
static double |
convertMetersToMiles(double meters)
converts meters to miles. |
static boolean |
isPowerOfTwo(int value)
Convenience method for testing whether a value is a power of two. |
static double |
logBase2(double value)
Convenience method to compute the log base 2 of a value. |
static int |
powerOfTwoCeiling(int reference)
Returns the value that is the nearest power of 2 greater than or equal to the given value. |
static int |
powerOfTwoFloor(int reference)
Returns the value that is the nearest power of 2 less than or equal to the given value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WWMath()
| Method Detail |
|---|
public static double clamp(double v,
double min,
double max)
v - the value to clamp.min - the floor.max - the ceiling
public static double convertMetersToFeet(double meters)
meters - the value in meters.
public static double convertMetersToMiles(double meters)
meters - the value in meters.
public static boolean isPowerOfTwo(int value)
value - the value to test for power of 2
public static double logBase2(double value)
value - the value to take the log of.
public static int powerOfTwoCeiling(int reference)
reference - the reference value. The power of 2 returned is greater than or equal to this value.
public static int powerOfTwoFloor(int reference)
reference - the reference value. The power of 2 returned is less than or equal to this value.
|
NASA World Wind | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||