Here you can find the source of ellipseCircumference(double a, double b)
Parameter | Description |
---|---|
a | a parameter |
b | a parameter |
public static double ellipseCircumference(double a, double b)
//package com.java2s; /*//from w ww .ja va 2s . c o m MathUtils.java (c) 2012 Edward Swartz All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html */ public class Main { /** * Estimate the circumference of an ellipse. * * @from http://en.wikipedia.org/wiki/Ellipse#Circumference * @param a * @param b * @return */ public static double ellipseCircumference(double a, double b) { if (a + b == 0) return 0; double aDb = a - b; double aPb = a + b; double diffSumQuotSq3 = 3 * (aDb / aPb) * (aDb / aPb); double dividend1 = diffSumQuotSq3; double divisor1 = 10 + Math.sqrt(4 - diffSumQuotSq3); return Math.PI * (a + b) * (1 + dividend1 / divisor1); } }