Package dev.oxydien.mathimations.utils
Class TriGeoUtils
java.lang.Object
dev.oxydien.mathimations.utils.TriGeoUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic floatcosValue(float curMs, float min, float max, float period) Maps a cosine wave to a value between min and max over a given period.static floatsinValue(float curMs, float min, float max, float period) Maps a sine wave to a value between min and max over a given period.
-
Constructor Details
-
TriGeoUtils
public TriGeoUtils()
-
-
Method Details
-
sinValue
public static float sinValue(float curMs, float min, float max, float period) Maps a sine wave to a value between min and max over a given period.- Parameters:
curMs- Current time/offset value (x-axis input)min- Minimum output valuemax- Maximum output valueperiod- Duration of one complete sine wave cycle in seconds- Returns:
- Value between min and max following a sine wave pattern
-
cosValue
public static float cosValue(float curMs, float min, float max, float period) Maps a cosine wave to a value between min and max over a given period.- Parameters:
curMs- Current time/offset value (x-axis input)min- Minimum output valuemax- Maximum output valueperiod- Duration of one complete cosine wave cycle in seconds- Returns:
- Value between min and max following a cosine wave pattern
-