• AddThis Social Bookmark Button

    Add to Technorati Favorites

  • Archives

  • Taking out the area of circle,rectangle,sphere and triangle

    By krates | February 2, 2008

    Sometimes you want to take out the area of circle,rectangle,sphere and triangle

    Here i will tell you how

     Circle

    function areaOfCircle(radius) { return Math.PI * Math.pow(radius, 2); }

    Rectangle 

    function areaOfRectangle(width, height) { return width * height; }

    Sphere

    function areaOfSphere(radius) { return 4 * Math.PI * (Math.pow(radius, 2)); }

    Triangle 

    function areaOfTriangle(baseWidth, height) { return baseWidth * height / 2; }

    Thanks

    krates

    Share and Enjoy:
    • del.icio.us
    • Technorati
    • Digg
    • StumbleUpon
    • Ma.gnolia
    • Furl
    • Reddit
    • Slashdot
    • Spurl
    • YahooMyWeb

    Topics: Javascript |

    Related Links:

    One Response to “Taking out the area of circle,rectangle,sphere and triangle”

    1. bob Says:
      February 10th, 2008 at 7:51 pm

      4fIogU hi great site thx http://peace.com

    Comments