public class AnimationSupport extends Object
Constructor and Description |
---|
AnimationSupport() |
Modifier and Type | Method and Description |
---|---|
static double |
angularRatio(Angle x,
Angle y)
Calculate the angular ratio between two angles
|
static double |
basicInterpolant(double interpolant,
double startInterpolant,
double stopInterpolant,
int maxSmoothing)
Calculate a normalized, smoothed interpolant
|
static double |
clampDouble(double value,
double min,
double max)
Clamps a value between a minimum and maximum
|
static long |
getScaledTimeMillisecs(Angle begin,
Angle end,
Angle max,
long minTimeMillisecs,
long maxTimeMillisecs)
Calculate a scaled tiome based on the ratio of the angular distance between the
begin and
end angles over the max value. |
static long |
getScaledTimeMillisecs(double beginZoom,
double endZoom,
long minTimeMillisecs,
long maxTimeMillisecs)
Calculate a scaled time based on the ratio of the distance between the
beginZoom and
endZoom distances over the larger of the beginZoom and endZoom. |
static long |
getScaledTimeMillisecs(LatLon beginLatLon,
LatLon endLatLon,
long minTimeMillis,
long maxTimeMillis)
Calcualte a scaled time based on the great circle distance between two points.
|
static double |
interpolantNormalized(double amount,
double startAmount,
double stopAmount)
Normalize an interpolant value
|
static double |
interpolantSmoothed(double interpolant,
int smoothingIterations)
Smooth an interpolant value using hermite smoothing
|
static double |
mixDouble(double amount,
double value1,
double value2)
Calculate the linear interpolation between two values
|
public static double angularRatio(Angle x, Angle y)
x
- The numeratory
- The denominatorx/y>
public static double basicInterpolant(double interpolant, double startInterpolant, double stopInterpolant, int maxSmoothing)
interpolant
- the unsmoothed, unnormalized interpolantstartInterpolant
- the lower end of interpolant rangestopInterpolant
- the higher end of the interpolant rangemaxSmoothing
- the numver of iterations to smooth.public static double clampDouble(double value, double min, double max)
value
- the value to clamomin
- the minimummax
- the maximumpublic static long getScaledTimeMillisecs(Angle begin, Angle end, Angle max, long minTimeMillisecs, long maxTimeMillisecs)
begin
and
end
angles over the max value.begin
- the begin angleend
- the end anglemax
- the maximun number of degreesminTimeMillisecs
- the minimum length of timemaxTimeMillisecs
- the maximum length of timepublic static long getScaledTimeMillisecs(double beginZoom, double endZoom, long minTimeMillisecs, long maxTimeMillisecs)
beginZoom
and
endZoom
distances over the larger of the beginZoom and endZoom.beginZoom
- the begin zoom valueendZoom
- the end zoom valueminTimeMillisecs
- the minimum length of timemaxTimeMillisecs
- the maximum length of timepublic static long getScaledTimeMillisecs(LatLon beginLatLon, LatLon endLatLon, long minTimeMillis, long maxTimeMillis)
minLengthMillis
and the maxLengthMillis
using the ratio
of the spherical distance between the given positions over 180 degrees.beginLatLon
- The first geographic positionendLatLon
- The second geographio positionminTimeMillis
- The minimum length of tinemaxTimeMillis
- The maximum length of timepublic static double interpolantNormalized(double amount, double startAmount, double stopAmount)
amount
- The value to normalizestartAmount
- The lower end of the rangestopAmount
- The upper end of the rangepublic static double interpolantSmoothed(double interpolant, int smoothingIterations)
interpolant
- The interpolantsmoothingIterations
- the number of smoothing iterationspublic static double mixDouble(double amount, double value1, double value2)
amount
- The interpolant, a number between 0 and 1.value1
- The minimum value of the rangevalue2
- The maximum value of the range