<HTML>
<HEAD>
</HEAD>
<BODY>
<SCRIPT>
// Add the cosec function to the Math object
function cosec(aValue)
{
return 1/Math.sin(aValue);
}
// Register the new function
Math.constructor.prototype.cosec = cosec;
// Test the Math.cosec() method
document.write(Math.cosec(2))
document.write("<BR>")
</SCRIPT>
</BODY>
</HTML>| See also: | Math.cot(), Math.sec() |
| Prev | Home | Next |
| Math.cos() | Up | Math.cosh() |
JavaScript Programmer's Reference, Cliff Wootton Wrox Press (www.wrox.com) Join the Wrox JavaScript forum at p2p.wrox.com Please report problems to support@wrox.com © 2001 Wrox Press. All Rights Reserved. Terms and conditions. | ||