<HTML> <HEAD> </HEAD> <BODY> <SCRIPT> // Add the sinh function to the Math object function sinh(aValue) { var myTerm1 = Math.pow(Math.E, aValue); var myTerm2 = Math.pow(Math.E, -aValue); return (myTerm1-myTerm2)/2; } // Register the new function Math.constructor.prototype.sinh = sinh; // Test the Math.sinh() method document.write(Math.sinh(2)) document.write("<BR>") </SCRIPT> </BODY> </HTML>
Prev | Home | Next |
Math.sin() | Up | Math.sqrt() |
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. |