Thursday, January 28, 2016

PHP ELLIPSE AREA: Solve for the Area of an Ellipse

Hi there! The following tutorial will introduce you to one of the most common problems encountered in programming subjects. Later on, I will provide set of activities and quizzes for you to practice on to improve your programming skills.

Area solver for shapes is just one of the exercises given by most programming instructors. Some other exercises are the following:

1. Celsius to Fahrenheit Temperature Converter
2. Identify if odd or even number
3. Display numbers using a for loop
4. Solve for the area of a triangle
5. Fibonacci Series

and many more. These are just some of the activities that I posted here in my blog. You can visit the links if you want.

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.

Try PHP Ellipse Area Live Here!

Visit Java Solve for the Area of Ellipse here.

Formula Area of Ellipse

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
echo number_format($area,2);

Output area of ellipse


Thank you for visiting and hope this helps you. Feel free to leave a comment below for any questions. I got some other articles related to php and mysql here in my blog. Watch out for more upcoming tutorials related to blogging and programming. Good day! ^_^

PHP ELLIPSE AREA: Solve for the Area of an Ellipse

No comments:

Post a Comment