Ellipse
| Kind of class: | class |
|---|---|
| Inherits from: | CoreObject |
| Implements: | |
| Version: | 11/10/06 |
| Author: | Aaron Clinger |
| Classpath: | org.casaframework.math.geom.Ellipse |
| File last modified: | Wednesday, 24 January 2007, 21:45:39 |
Stores position and size of an ellispe (circle or oval).
Summary
Constructor
Instance properties
Instance properties inherited from CoreObject
Instance methods
- getX
- setX
- getY
- setY
- getPosition
- setPosition
- getWidth
- setWidth
- getHeight
- setHeight
- getPerimeter
- getArea
- getPointOfDegree
- containsPoint
- equals
- clone
- destroy
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
function clone (
) : Ellipse
Returns:
A new ellipse object with the same values as this ellipse.
containsPoint
function containsPoint (
pointObject:Point) : Boolean
Finds if point is contained inside the shape's perimeter.
#Returns:
Returns
#true if area contains point; otherwise false.Specified by:
destroy
function destroy (
) : Void
Removes internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.
Always call
#Always call
destroy() before deleting/removing object instance.Specified by:
equals
function equals (
ellipseObject:Object) : Boolean
Determines whether the ellipse specified in the
ellipseObject parameter is equal to this ellipse object.Parameters:
ellipseObject:
A defined Ellipse object.
Returns:
Returns
true if shape's location and size is identical; otherwise false.getHeight
function getHeight (
) : Number
Returns:
The height of the shape at its tallest point.
#Specified by:
getPerimeter
function getPerimeter (
) : Number
Returns:
The distance around the shape.
#Usage note:
Calculating the circumference of an ellipse is difficult; this is an approximation but should be fine for most cases.
Specified by:
getPointOfDegree
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 defined Point object.
Usage note:
degree can be over 360 or even negitive numbers; minding 0 = 360 = 720, 540 = 180, -90 = 270, etc...getWidth
function getWidth (
) : Number
Returns:
The width of the shape at its widest point.
#Specified by:
setHeight
function setHeight (
height:Number) : Void
Sets the height of the shape at its tallest point.
#Parameters:
height:
Height of the shape.
#Specified by:
setPosition
function setPosition (
pointObject:Point) : Void
Sets the value of the top left X and Y position of the shape.
#Specified by:
setWidth
function setWidth (
width:Number) : Void
Sets the width of the shape at its widest point.
#Parameters:
width:
Width of the shape.
#Specified by:
setX
function setX (
x:Number) : Void
Sets the X coordinate.
#Parameters:
x:
The horizontal coordinate of the point.
#Specified by: