Here you can find the source of ellipseCircum(double a, double b)
public static double ellipseCircum(double a, double b)
//package com.java2s; // under the terms of the GNU Lesser General Public License as published public class Main { /**//from w w w . ja v a2 s. co m * Returns the approximate circumference of the ellipse defined by the * specified minor and major axes. The formula used (due to Ramanujan, * via a paper of his entitled "Modular Equations and Approximations * to Pi"), is <code>Pi(3a + 3b - sqrt[(a+3b)(b+3a)])</code>. */ public static double ellipseCircum(double a, double b) { return Math.PI * (3 * a + 3 * b - Math.sqrt((a + 3 * b) * (b + 3 * a))); } }