Math Functions
    & Constants



Forms w/o the WWW
Self-Grading Quiz
Drill w/o WWW
Convert decimal to hexadecimal
Sample
3. The perimeter, P(L, W) = 2(L) + 2(W), or the
area, A(L, W) = (L)(W), of a rectangle.
 
Width:  
Lenght:   
 
    is

Code for the form
	
<!----Rectangle Area or Perimeter form-------> <A NAME="#rectap"></A>

<TABLE width=550 bgcolor="#ffffcc"><TR align=left valign=top>
<TD><DL><DT>3. The perimeter, P(L, W) = 2(L) + 2(W), or the <DD>area, A(L, W) = (L)(W), of a rectangle. <DD>  <FORM> <DD><TABLE><TR><TD><IMG SRC="rect.gif"></TD> <TD>Width:  <INPUT type=text value=0 name=second size=4></TD></TR><TR> <TD>Lenght:  <INPUT type=text name=first value=0 size=4></TD><TD> </TD> </TR></TABLE> <DD>   <DD> <INPUT type=button value="Area:" onClick="this.form.result.value= (this.form.first.value) * (this.form.second.value)">   <INPUT type=button value="Perimeter:" onClick="this.form.result.value= 2 * (this.form.first.value) + 2 * (this.form.second.value)">   is <INPUT type=TEXT value="0" name=result size=10> </FORM></DL></TD></TR></TABLE><BR><!-- -----end area or perimeter form ------>
Constants
Math.E Base of the natural log, e.
Math.LN10 Natural logarithm of 10.
Math.LN2 Natural logarithm of 2.
Math.LOG10E Log, base-10, of e.
Math.LOG2E Log, base 2, of e.
Math.PI Pi.
Math.SQRT1_2 One divided by the square root of 2.
Math.SQRT2 Square root of 2.
Functions
Math.abs( ) Absolute value.
Math.sqrt( ) Square root.
Math.pow(x,y) Compute x-to-the-y.
Math.ceil() Round up.
Math.floor( ) Round down.
Math.max( ) Larger of two numbers.
Math.min( ) Smaller of two numbers.
Math.round( ) Round to the nearest integer.
Math.random( ) Pseudo-random number.
Math.exp( ) Compute an exponent of e.
Math.log( ) Compute a natural logarithm of a positive number.
pi/180 is about 0.017453293
Math.sin( ) Sine of a radian measure
Math.cos( ) Cosine of a radian measure
Math.tan( ) Tangent of a radian measure
Math.asin( ) Arcsine -- returns a radian measure.
Math.acos( ) Arccosine -- returns a radian measure.
Math.atan( ) Arctangent -- returns a radian measure.
Math.atan2(x,y) Compute the angle, in radians, from the X-axis to a point (x,y).

[MC,i. Home] [Words] Classes Web Stuff Classes [Good Stuff]
www.mathnstuff.com/papers/webstuf/mathfun.htm
© 2008, A. Azzolino