Point

Kind of class:class
Inherits from:CoreObject
Implements:
Known subclasses:
Version:03/21/08
Author:Aaron Clinger, David Bliss
Classpath:org.casalib.math.geom.Point
File last modified:Monday, 01 December 2008, 13:34:40
Stores location of a point in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

Summary


Constructor
  • Point (x:Number, y:Number)
    • Creates point object.
Class methods
  • distance (firstPoint:Point) : Number
    • Determines the distance between the first and second points.
  • angle (firstPoint:Point) : Number
    • Determines the angle/degree between the first and second point.
Instance methods
  • getX : Number
  • setX (x:Number) : Void
    • Sets the X coordinate.
  • getY : Number
  • setY (y:Number) : Void
    • Sets the Y coordinate.
  • offset (x:Number, y:Number) : Void
    • Offsets the Point object by the specified amount.
  • rotate (pointObject:Point, angle:Number) : Void
    • Rotate the Point object around another point by the specified angle.
  • equals (pointObject:Point) : Boolean
    • Determines whether the point specified in the pointObject parameter is equal to this point object.
  • clone : Point
  • destroy : Void
    • Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.
Instance methods inherited from CoreObject

Constructor

Point

function Point (
x:Number, y:Number)

Creates point object.
Parameters:
x:
The horizontal coordinate of the point.
y:
The vertical coordinate of the point.

Class methods

angle

static function angle (
firstPoint:Point, secondPoint:Point) : Number

Determines the angle/degree between the first and second point.
Parameters:
firstPoint :
The first point.
secondPoint:
The second point.

distance

static function distance (
firstPoint:Point, secondPoint:Point) : Number

Determines the distance between the first and second points.
Parameters:
firstPoint :
The first point.
secondPoint:
The second point.

Instance methods

clone

function clone (
) : Point

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

destroy

function destroy (
) : Void

Removes any internal variables, intervals, enter frames, internal MovieClips and event observers to allow the object to be garbage collected.

Always call pointObject before deleting last object pointer.
#

equals

function equals (
pointObject:Point) : Boolean

Determines whether the point specified in the pointObject parameter is equal to this point object.
Parameters:
pointObject:
A defined Point object.
Returns:
  • Returns true if shape's location is identical; otherwise false.

getX

function getX (
) : Number

Returns:
  • The left X position.
    #
Specified by:

getY

function getY (
) : Number

Returns:
  • The top Y position.
    #
Specified by:

offset

function offset (
x:Number, y:Number) : Void

Offsets the Point object by the specified amount.
Parameters:
x:
The amount by which to offset the horizontal coordinate.
y:
The amount by which to offset the vertical coordinate.

rotate

function rotate (
pointObject:Point, angle:Number) : Void

Rotate the Point object around another point by the specified angle.
Parameters:
pointObject:
The Point to rotate this point around.
angle :
The angle (in degrees) to rotate this point.

setX

function setX (
x:Number) : Void

Sets the X coordinate.
#
Parameters:
x:
The horizontal coordinate of the point.
#
Specified by:

setY

function setY (
y:Number) : Void

Sets the Y coordinate.
#
Parameters:
y:
The vertical coordinate of the point.
#
Specified by: