Package gov.nasa.worldwind.animation
Class AnimationSupport
- java.lang.Object
-
- gov.nasa.worldwind.animation.AnimationSupport
-
public class AnimationSupport extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description AnimationSupport()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static double
angularRatio(Angle x, Angle y)
Calculate the angular ratio between two anglesstatic double
basicInterpolant(double interpolant, double startInterpolant, double stopInterpolant, int maxSmoothing)
Calculate a normalized, smoothed interpolantstatic double
clampDouble(double value, double min, double max)
Clamps a value between a minimum and maximumstatic long
getScaledTimeMillisecs(double beginZoom, double endZoom, long minTimeMillisecs, long maxTimeMillisecs)
Calculate a scaled time based on the ratio of the distance between thebeginZoom
andendZoom
distances over the larger of the beginZoom and endZoom.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 thebegin
andend
angles over the max value.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 valuestatic double
interpolantSmoothed(double interpolant, int smoothingIterations)
Smooth an interpolant value using hermite smoothingstatic double
mixDouble(double amount, double value1, double value2)
Calculate the linear interpolation between two values
-
-
-
Method Detail
-
getScaledTimeMillisecs
public static long getScaledTimeMillisecs(LatLon beginLatLon, LatLon endLatLon, long minTimeMillis, long maxTimeMillis)
Calcualte a scaled time based on the great circle distance between two points. The time is calulated by interpolating between theminLengthMillis
and themaxLengthMillis
using the ratio of the spherical distance between the given positions over 180 degrees.- Parameters:
beginLatLon
- The first geographic positionendLatLon
- The second geographio positionminTimeMillis
- The minimum length of tinemaxTimeMillis
- The maximum length of time- Returns:
- The scaled time in milliseconds.
-
getScaledTimeMillisecs
public 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 thebegin
andend
angles over the max value.- Parameters:
begin
- the begin angleend
- the end anglemax
- the maximun number of degreesminTimeMillisecs
- the minimum length of timemaxTimeMillisecs
- the maximum length of time- Returns:
- the scaled time in milliseconds
-
getScaledTimeMillisecs
public static long getScaledTimeMillisecs(double beginZoom, double endZoom, long minTimeMillisecs, long maxTimeMillisecs)
Calculate a scaled time based on the ratio of the distance between thebeginZoom
andendZoom
distances over the larger of the beginZoom and endZoom.- Parameters:
beginZoom
- the begin zoom valueendZoom
- the end zoom valueminTimeMillisecs
- the minimum length of timemaxTimeMillisecs
- the maximum length of time- Returns:
- the scaled time in milliseconds
-
angularRatio
public static double angularRatio(Angle x, Angle y)
Calculate the angular ratio between two angles- Parameters:
x
- The numeratory
- The denominator- Returns:
- The angular ratio of
x/y
-
mixDouble
public static double mixDouble(double amount, double value1, double value2)
Calculate the linear interpolation between two values- Parameters:
amount
- The interpolant, a number between 0 and 1.value1
- The minimum value of the rangevalue2
- The maximum value of the range- Returns:
- the interpolated value
-
clampDouble
public static double clampDouble(double value, double min, double max)
Clamps a value between a minimum and maximum- Parameters:
value
- the value to clamomin
- the minimummax
- the maximum- Returns:
- the clamped value
-
interpolantNormalized
public static double interpolantNormalized(double amount, double startAmount, double stopAmount)
Normalize an interpolant value- Parameters:
amount
- The value to normalizestartAmount
- The lower end of the rangestopAmount
- The upper end of the range- Returns:
- the normalized interpolant
-
interpolantSmoothed
public static double interpolantSmoothed(double interpolant, int smoothingIterations)
Smooth an interpolant value using hermite smoothing- Parameters:
interpolant
- The interpolantsmoothingIterations
- the number of smoothing iterations- Returns:
- the smoothed interpolant
-
basicInterpolant
public static double basicInterpolant(double interpolant, double startInterpolant, double stopInterpolant, int maxSmoothing)
Calculate a normalized, smoothed interpolant- Parameters:
interpolant
- the unsmoothed, unnormalized interpolantstartInterpolant
- the lower end of interpolant rangestopInterpolant
- the higher end of the interpolant rangemaxSmoothing
- the numver of iterations to smooth.- Returns:
- the normalized, smoothed interpolant
-
-