Web Hosting Directory | Web Hosting Resources | Webmaster Resources | Domain Tools | Search Engine Marketing | Forums
  Signup
Today: 1,262   Yesterday: 1,015   Max: 1,872   Total: 464,315   Current Users : 16 (Member 0) 
DOMAIN TOOLS

WEBMASTER TOOLS

RELATED ARTICLES

SUBMIT AN ARTICLE

Write for us and get publicity, link to your website, and best of all get paid. Please visit our writers page for details.


LINK TO US

Link to us and earn points for each visitor you bring to us. Please visit our link partner page for details.

 
back to Forms and Scripts

Source Code for Geometric Properties Form

This code creates the geometric properties form:

<SCRIPT TYPE="text/javascript">
<!--
function Circle_calc(GeoForm)
{
var CircleRadius = GeoForm.Circle_radius.value;
if (CircleRadius >= 0)
   {
   GeoForm.Circle_circumference.value =  2 * Math.PI * CircleRadius ;
   GeoForm.Circle_area.value =  Math.PI * Math.pow(CircleRadius, 2) ;
   }
else
   {
   GeoForm.Circle_circumference.value =  "";
   GeoForm.Circle_area.value =  "";
   }
}

function Cone_calc(GeoForm)
{
var ConeRadius = GeoForm.Cone_radius.value;
var ConeHeight = GeoForm.Cone_height.value;

if ((ConeRadius >= 0) && (ConeHeight >= 0))
   {
   GeoForm.Cone_surfacearea.value = (Math.PI * Math.pow(ConeRadius, 2)) + (Math.PI * ConeRadius * Math.sqrt(Math.pow(ConeRadius, 2) + Math.pow(ConeHeight, 2)));
   GeoForm.Cone_volume.value = (1/3) * Math.PI * Math.pow(ConeRadius,2) * ConeHeight;
   }
else
   {
   GeoForm.Cone_surfacearea.value = "";
   GeoForm.Cone_volume.value = "";
   }
}

function Sphere_calc(GeoForm)
{
var SphereRadius = GeoForm.Sphere_radius.value;

if (SphereRadius >= 0) 
   {
   GeoForm.Sphere_surfacearea.value = 4 * Math.PI * Math.pow(SphereRadius, 2);
   GeoForm.Sphere_volume.value = (4/3) * Math.PI * Math.pow(SphereRadius, 3);
   }
else
   {
   GeoForm.Sphere_surfacearea.value = "";
   GeoForm.Sphere_volume.value = "";
   }
}
// -->
</SCRIPT>

<FORM>
<TABLE BORDER CELLPADDING=3>
<!-- circumference and radius of a circle -->
<TR>

<TH>Circumference and Radius of a Circle<BR><IMG SRC="../graphics/circle.gif" HEIGHT=88 WIDTH=88 ALT="picture of a circle"></TH>
<TD><NOBR>radius: <INPUT NAME="Circle_radius" SIZE=4></NOBR></TD>
<TD><INPUT TYPE=BUTTON OnClick="Circle_calc(this.form);" VALUE="calculate"></TD>
<TD ALIGN=RIGHT BGCOLOR="#AACCFF">
   <NOBR>circumference: <INPUT NAME="Circle_circumference" SIZE=9></NOBR><BR>
   <NOBR>area: <INPUT NAME="Circle_area" SIZE=9></NOBR></TD>
</TR>

<!-- Surface area and volume of a cone -->
<TR>
<TH>Surface Area and Volume of a Cone<BR><IMG SRC="../graphics/cone.gif" HEIGHT=106 WIDTH=115 ALT="picture of a cone"></TH>
<TD ALIGN=RIGHT><NOBR>radius: <INPUT NAME="Cone_radius" SIZE=4></NOBR><BR>
   <NOBR>height: <INPUT NAME="Cone_height" SIZE=4></NOBR></TD>
<TD><INPUT TYPE=BUTTON OnClick="Cone_calc(this.form);" VALUE="calculate"></TD>
<TD ALIGN=RIGHT BGCOLOR="#AACCFF">
   <NOBR>surface area: <INPUT NAME="Cone_surfacearea" SIZE=9></NOBR><BR>
   <NOBR>volume: <INPUT NAME="Cone_volume" SIZE=9></NOBR></TD>
</TR>

<!-- Surface Area and Volume of a Sphere -->
<TR>
<TH>Surface Area and Volume of a Sphere<BR><IMG SRC="../graphics/sphere.gif" HEIGHT=88 WIDTH=88 ALT="picture of a sphere"></TH>
<TD><NOBR>radius: <INPUT NAME="Sphere_radius" SIZE=4></NOBR></TD>
<TD><INPUT TYPE=BUTTON OnClick="Sphere_calc(this.form);" VALUE="calculate"></TD>
<TD ALIGN=RIGHT BGCOLOR="#AACCFF"><NOBR>surface area: <INPUT NAME="Sphere_surfacearea" SIZE=9></NOBR><BR>
   <NOBR>volume: <INPUT NAME="Sphere_volume" SIZE=9></NOBR></TD>
            
</TR>
</TABLE>
</FORM>

which gives us this form:

Circumference and Radius of a Circle
picture of a circle
radius: circumference:
area:
Surface Area and Volume of a Cone
picture of a cone
radius:
height:
surface area:
volume:
Surface Area and Volume of a Sphere
picture of a sphere
radius: surface area:
volume:


Copyright 1997-2002 Idocs, Inc. Written by Miko Sullivan.

 
 
 
What is your major source of website traffic?
 
 
 
 
 
 

ADVERTISEMENT

 
Cheap Web HostingBudget Web HostingEcommerce Web Hosting
Link to UsLink ExchangeAdvertisePrivacy PolicyTerms Of ServiceAbout UsContact UsSitemap
Copyright © 2006 - 2008 Broadband Media, Inc. All rights reserved.