/**
 * Constant coefficient to convert degrees to radians.
 */ export const deg2rad = Math . PI / 180 ; /**
 * Constant coefficient to convert radians to degrees.
 */ export const rad2deg = 180 / Math . PI ; /**
 * A small value to approximately compare values.
 */ export const epsilon = 0.000001 ; /**
 * Linearly interpolates between a and b by t.
 */ export function lerp ( a , b , t ) { return ( 1 - t ) * a + t * b ; } /**
 * Smoothly interpolates between a and b by t (using cosine interpolation).
 */ export function slerp ( a , b , t ) { return lerp ( a , b , ( 1 - Math . cos ( t * Math . PI ) ) / 2 ) ; } /**
 * Inversely lerps v between a and b to find t.
 */ export function invlerp ( a , b , v ) { return ( v - a ) / ( b - a ) ; } /**
 * Clamps the specified value between a minimum and a maximum.
 */ export function clamp ( value , min , max ) { return Math . min ( max , Math . max ( min , value ) ) ; } /**
 * Checks if a is approximately equal to b.
 */ export function approximately ( a , b ) { return Math . abs ( a - b ) < epsilon ; }