An ellipse is described as a curve on a plane that surrounds two focal points such that the sum of the distances to the two focal points is constant for every point on the curve. Ellipse has two types of axis – Major Axis and Minor Axis. The longest chord of the ellipse is the major axis. The perpendicular chord to the major axis is the minor axis which bisects the major axis at the center.
Given the lengths of minor and major axis of an ellipse, the task is to find the perimeter of the Ellipse.
Input: a = 3, b = 2
Input: a = 9, b = 5
Perimeter of an ellipse is:
Perimeter : 2π * sqrt( (a2 + b2) / 2 )
Where a and b are semi-major axis and semi-minor axis respectively.
Below is the implementation of the above approach:
// C# program to find perimeter of
// an Ellipse.
// Function to find perimeter of an
static void Perimeter(double a, double b)
// formula to find the Perimeter
// of an Ellipse.
Perimeter = (double)2 * 3.14 *
Math.Sqrt((a * a + b * b) / (2 * 1.0));
// Display the result
Console.WriteLine(“Perimeter: ” + Perimeter);
// Driver code
public static void Main (String args)
double a = 3, b = 2;
Perimeter(a , b);
// This code is contributed by Princi Singh
- Program to find the Area of an Ellipse
- Largest triangle that can be inscribed in an ellipse
- Check if a point is inside, outside or on the ellipse
- Midpoint ellipse drawing algorithm
- Area of the biggest ellipse inscribed within a rectangle
- Area of the Largest square that can be inscribed in an ellipse
- Area of Largest rectangle that can be inscribed in an Ellipse
- Equation of ellipse from its focus, directrix, and eccentricity
- Find the area of largest circle inscribed in ellipse
- Find the perimeter of a cylinder
- Find Perimeter of a triangle
- Minimum Perimeter of n blocks
- Maximum area of rectangle possible with given perimeter
- Program to Calculate the Perimeter of a Decagon
- Perimeter of Convex hull for a given set of points
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.