Write methods

public static double perimeter(Ellipse2D.Double e);
public static double area(Ellipse2D.Double e);

that compute the area and the perimeter of the ellipse e. Add these methods to a class Geometry. The challenging part of this assignment is to find and implement an accurate formula for the perimeter. Why does it make sense to use a static method in this case?

Complete the following files:



Use the following file:


import java.awt.geom.Ellipse2D;

   This is a tester for the ellipse geometry methods.
public class EllipseTester
   public static void main(String[] args)
      Ellipse2D.Double e = new Ellipse2D.Double(100, 100, 200, 100);
      System.out.println("Area: " + Geometry.area(e));
      System.out.println("Expected: 15707.96326794896619231322");

      System.out.println("Perimeter: " + Geometry.perimeter(e));
      System.out.println("Expected: 484.42241102738376");
      // from http://www.jgiesen.de/kepler/arc/ellipseArc2.html