Class Ellipse

java.lang.Object
inra.ijpb.geometry.Ellipse

public class Ellipse
extends java.lang.Object
Represents a 2D ellipse.
Author:
dlegland
  • Constructor Summary

    Constructors
    Constructor Description
    Ellipse​(double xc, double yc, double radius1, double radius2, double theta)
    Creates a new ellipse.
    Ellipse​(java.awt.geom.Point2D center, double radius1, double radius2, double theta)
    Creates a new ellipse.
  • Method Summary

    Modifier and Type Method Description
    double area()  
    java.awt.geom.Point2D center()  
    static java.awt.geom.Point2D[] centers​(Ellipse[] ellipses)
    Initializes center array from ellipse array.
    double orientation()  
    double radius1()  
    double radius2()  
    java.lang.String toString()  

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
  • Constructor Details

    • Ellipse

      public Ellipse​(java.awt.geom.Point2D center, double radius1, double radius2, double theta)
      Creates a new ellipse.
      Parameters:
      center - the center of the ellipse
      radius1 - the length of the major semi-axis
      radius2 - the length of the minor semi-axis
      theta - the orientation of the ellipse, in degrees
    • Ellipse

      public Ellipse​(double xc, double yc, double radius1, double radius2, double theta)
      Creates a new ellipse.
      Parameters:
      xc - the x-coordinate of the center of the ellipse
      yc - the y-coordinate of the center of the ellipse
      radius1 - the length of the major semi-axis
      radius2 - the length of the minor semi-axis
      theta - the orientation of the ellipse, in degrees
  • Method Details

    • centers

      public static final java.awt.geom.Point2D[] centers​(Ellipse[] ellipses)
      Initializes center array from ellipse array.
      Parameters:
      ellipses - an array of ellipses
      Returns:
      the array of points corresponding to the centers of the ellipses.
    • area

      public double area()
      Returns:
      the area of the domain enclosed by this ellipse
    • center

      public java.awt.geom.Point2D center()
      Returns:
      the center of this ellipse
    • radius1

      public double radius1()
      Returns:
      the length of the major semi-axis
    • radius2

      public double radius2()
      Returns:
      the length of the minor semi-axis
    • orientation

      public double orientation()
      Returns:
      the orientation of the ellipse, in degrees
    • toString

      public java.lang.String toString()
      Overrides:
      toString in class java.lang.Object