# Ellipse

Kind of class: public class org.casalib.math.geom none 04/13/08 Aaron Clinger, Mike Creighton org.casalib.math.geom.Ellipse Thursday, 19 February 2009, 11:33:36
Stores position and size of an ellipse (circle or oval).

## Summary

Constructor
• Ellipse (x:Number, y:Number, width:Number, height:Number)
• Creates new Ellipse object.
Instance properties
• x : Number
• The horizontal coordinate of the point.
• y : Number
• The vertical coordinate of the point.
• width : Number
• The width of the ellipse.
• height : Number
• The height of the rectangle.
• center : Point
• The center of the ellipse.
• size : Point
• The size of the ellipse, expressed as a Point object with the values of the width and height properties.
• perimeter : Number
• The circumference of the ellipse.
• area : Number
• The area of the ellipse.
Instance methods
• getPointOfDegree (degree:Number) : Point
• Finds the x, y position of the degree along the circumference of the ellipse.
• containsPoint (point:Point) : Boolean
• Finds if point is contained inside the ellipse perimeter.
• equals (ellipse:Ellipse) : Boolean
• Determines if the Ellipse specified in the ellipse parameter is equal to this Ellipse object.
• clone

## Constructor

### Ellipse

public function Ellipse (
x:Number, y:Number, width:Number, height:Number)

Creates new Ellipse object.
Parameters:
x :
The horizontal position of the ellipse.
y :
The vertical position of the ellipse.
width :
Width of the ellipse at its widest horizontal point.
height:
Height of the ellipse at its tallest point.

## Instance properties

### area

public area:Number

The area of the ellipse.

### center

public center:Point

The center of the ellipse.

### height

public height:Number

The height of the rectangle.

### perimeter

public perimeter:Number

The circumference of the ellipse.
Usage note:
• Calculating the circumference of an ellipse is difficult; this is an approximation but should be fine for most cases.

### size

public size:Point

The size of the ellipse, expressed as a Point object with the values of the width and height properties.

### width

public width:Number

The width of the ellipse.

### x

public x:Number

The horizontal coordinate of the point.

### y

public y:Number

The vertical coordinate of the point.

## Instance methods

### clone

public function clone (

Returns:
• A new Ellipse object with the same values as this Ellipse.

### containsPoint

public function containsPoint (
point:Point) : Boolean

Finds if point is contained inside the ellipse perimeter.
Parameters:
point:
A Point object.
Returns:
• Returns `true` if shape's area contains point; otherwise `false`.

### equals

public function equals (
ellipse:Ellipse) : Boolean

Determines if the Ellipse specified in the `ellipse` parameter is equal to this Ellipse object.
Parameters:
ellipse:
An Ellipse object.
Returns:
• Returns `true` if object is equal to this Ellipse; otherwise `false`.

### getPointOfDegree

public function getPointOfDegree (
degree:Number) : Point

Finds the `x`, `y` position of the degree along the circumference of the ellipse.
Parameters:
degree:
Number representing a degree on the ellipse.
Returns:
• A Point object.
Usage note:
• `degree` can be over 360 or even negitive numbers; minding `0 = 360 = 720`, `540 = 180`, `-90 = 270`, etc.