function cosd( x ) {
	var rx;

	if (
		isInfinite( x ) ||
		isnan( x )
	) {
		return NaN;
	}

	rx = abs( fmod( x, 360.0 ) );

	if ( rx <= 45.0 ) {
		return kernelCos( deg2rad( rx ), 0.0 );
	}
	if ( rx < 135.0 ) {
		return kernelSin( deg2rad( 90.0-rx ), 0.0 );
	}
	if ( rx <= 225.0 ) {
		return -kernelCos( deg2rad( 180.0-rx ), 0.0 );
	}
	if ( rx < 315.0 ) {
		return kernelSin( deg2rad( rx-270.0 ), 0.0 );
	}
	return kernelCos( deg2rad( 360.0-rx ), 0.0 );
}
Computes the cosine of an angle measured in degrees.

@param {number} x - input value (in degrees)
@returns {number} cosine

@example
var v = cosd( 0.0 );
// returns 1.0

@example
var v = cosd( 90.0 );
// returns 0.0

@example
var v = cosd( 60.0 );
// returns ~0.5

@example
var v = cosd( NaN );
// returns NaN