pingPong

open fun pingPong(t: Double, length: Double): Double
open fun pingPong(t: Float, length: Float): Float

PingPongs (bounces) the value t, so that it is never larger than length and never smaller than 0.

Return

The pingponged value.

Parameters

t

The value to pingpong.

length

The length of the pingpong.