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
Topics: Javascript |
Related Links:











February 10th, 2008 at 7:51 pm
4fIogU hi great site thx http://peace.com