interface Math { param value param min param max clamp ( value , min , max ) : number ; param degrees degToRad ( degrees ) : number ; param degrees radToDeg ( radians ) : number ; } ( Math as any ) . clamp = ( value , min , max ) : number => { if ( value < min ) { return min ; } if ( value > max ) { return max ; } return value ; } ; ( Math as any ) . degToRad = ( degrees ) : number => { return degrees * Math . PI / 180.0 ; } ; ( Math as any ) . radToDeg = ( radians ) : number => { return radians * 180.0 / Math . PI ; } ;