Nez.Portable/Math/Mathf.cs
/// <summary>
/// damped version of a lissajou curve with oscillation between 0 and max magnitude over time. Damping should be between 0 and 1 for best
/// results. oscillationInterval is the time in seconds for half of the animation loop to complete.
/// </summary>
/// <returns>The damped.</returns>
/// <param name="xFrequency">X frequency.</param>
/// <param name="yFrequency">Y frequency.</param>
/// <param name="xMagnitude">X magnitude.</param>
/// <param name="yMagnitude">Y magnitude.</param>
/// <param name="phase">Phase.</param>
/// <param name="damping">Damping.</param>
/// <param name="oscillationInterval">Oscillation interval.</param>
damped version of a lissajou curve with oscillation between 0 and max magnitude over time. Damping should be between 0 and 1 for best
results. oscillationInterval is the time in seconds for half of the animation loop to complete.
damped version of a lissajou curve with oscillation between 0 and max magnitude over time . Damping should be between 0 and 1 for best results . oscillationInterval is the time in seconds for half of the animation loop to complete .
[MethodImpl(MethodImplOptions.AggressiveInlining)]
        public static Vector2 lissajouDamped(
            float xFrequency = 2f,
            float yFrequency = 3f,
            float xMagnitude = 1,
            float yMagnitude = 1,
            float phase = 0.5f,
            float damping = 0f,
            float oscillationInterval = 5f)
        {
            var wrappedTime = Mathf.pingPong(Time.time, oscillationInterval);
            var damped = Mathf.pow(MathHelper.E, -damping * wrappedTime);
            var x = damped * Mathf.sin(Time.time * xFrequency + phase) * xMagnitude;
            var y = damped * Mathf.cos(Time.time * yFrequency) * yMagnitude;
            return new Vector2(x, y);
        }
[ MethodImpl ( MethodImplOptions . AggressiveInlining ) ] public static Vector2 lissajouDamped ( float xFrequency = 2f , float yFrequency = 3f , float xMagnitude = 1 , float yMagnitude = 1 , float phase = 0.5f , float damping = 0f , float oscillationInterval = 5f ) { var wrappedTime = Mathf . pingPong ( Time . time , oscillationInterval ) ; var damped = Mathf . pow ( MathHelper . E , - damping * wrappedTime ) ; var x = damped * Mathf . sin ( Time . time * xFrequency + phase ) * xMagnitude ; var y = damped * Mathf . cos ( Time . time * yFrequency ) * yMagnitude ; return new Vector2 ( x , y ) ; }
damped version of a lissajou curve with oscillation between 0 and max magnitude over time.
damped version of a lissajou curve with oscillation between 0 and max magnitude over time .
None
xFrequency
float
None
yFrequency
float
None
xMagnitude
float
None
yMagnitude
float
None
phase
float
None
damping
float
None
oscillationInterval
float
None