Thursday, January 28, 2016

PHP ELLIPSE AREA: Solve for the Area of an Ellipse

Ellipse is an oval shape quite similar with that of a circle but is elongated. I already posted articles related to solving for the area of a square, circle, rectangle, triangle and etc. The formula of the area of a circle is somewhat similar with that of the ellipse.

Visit Java Solve for the Area of Ellipse here.
Formula


A = Area of an Ellipse
a = distance from the center up to the edge (y-axis)
b = distance from the center to the right or left edge of an ellipse (x-axis)

Given: a= 4 and b=5 and we will just used the math function for pi.

PHP Code
<?php
$a=4;
$b=5;
$area=pi()*$a*$b;
echo number_format($area,2);
?>

Output

63.83

PHP ELLIPSE AREA: Solve for the Area of an Ellipse

PHP ELLIPSE AREA: Solve for the Area of an Ellipse Rating: 4.5 Diposkan Oleh: Emoblazz

0 comments:

Post a Comment