Ellipse
Kind of class: | class |
---|---|
Inherits from: | BaseShape < CoreObject |
Version: | 08/02/07 |
Author: | Aaron Clinger |
Classpath: | org.casalib.math.geom.Ellipse |
File last modified: | Monday, 01 December 2008, 13:34:40 |
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 methods
- getPerimeter : Number
- getArea : Number
- getPointOfDegree (degree:Number) : Point
- Finds the x, y position of the degree along the circumference of the ellipse.
- containsPoint (pointObject:Point) : Boolean
- equals (ellipseObject:Ellipse) : Boolean
- Determines whether the ellipse specified in the ellipseObject parameter is equal to this ellipse object.
- clone : Ellipse
- destroy : Void
Instance methods inherited from BaseShape
Instance methods inherited from CoreObject
Constructor
Ellipse
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:
[optional] Height of the ellipse at its tallest point. If
undefined
assumes height
matches width
(Creates circle).Instance methods
clone
Returns:
- A new ellipse object with the same values as this ellipse.
containsPoint
Overrides:
equals
Determines whether the ellipse specified in the
ellipseObject
parameter is equal to this ellipse object. Parameters:
rectangleObject:
A defined Ellipse object.
getPerimeter
function getPerimeter (
) : Number
Usage note:
- Calculating the circumference of an ellipse is difficult; this is an approximation but should be fine for most cases.
Overrides:
getPointOfDegree
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 defined Point object.
Usage note:
-
degree
can be over360
or even negitive numbers; minding0 = 360 = 720
,540 = 180
,-90 = 270
, etc...