Math.sec() (Simulated functionality)

The sec() function is not available in JavaScript but can be simulated to aid in the porting of existing code.

The example demonstrates how to add the sec() method to the Math object to provide the capability to calculate secants.

Example code:

   // Add the sec function to the Math object
   function sec(aValue)
   return 1/Math.cos(aValue);
   // Register the new function
   Math.constructor.prototype.sec = sec;
   // Test the Math.sec() method

See also:Math.cosec(), Math.cot()