Packagecom.threerings.util
Classpublic class LineSegment
ImplementsEqualable

Merely a typed container for two Points.



Public Properties
 PropertyDefined by
  start : Point
LineSegment
  stop : Point
LineSegment
Public Methods
 MethodDefined by
  
LineSegment(start:Point, stop:Point)
LineSegment
  
equals(o:Object):Boolean
LineSegment
  
Return the point at which the other line intersects us.
LineSegment
  
Tests if the given line intersects this line.
LineSegment
  
getLength():Number
Get the length of this line.
LineSegment
  
isIntersected(line:LineSegment):Boolean
LineSegment
Protected Methods
 MethodDefined by
  
getIntersection(line:LineSegment, returnPoint:Boolean):*
Internal method that calculates whether the other line intersects and returns either the intersected point or merely the intersection type.
LineSegment
Public Constants
 ConstantDefined by
  DOES_NOT_INTERSECT : int = 3
[static]
LineSegment
  INTERSECTION_NORTH : int = 1
[static]
LineSegment
  INTERSECTION_SOUTH : int = 2
[static]
LineSegment
Property detail
startproperty
public var start:Point
stopproperty 
public var stop:Point
Constructor detail
LineSegment()constructor
public function LineSegment(start:Point, stop:Point)Parameters
start:Point
 
stop:Point
Method detail
equals()method
public function equals(o:Object):BooleanParameters
o:Object

Returns
Boolean
getIntersection()method 
protected function getIntersection(line:LineSegment, returnPoint:Boolean):*

Internal method that calculates whether the other line intersects and returns either the intersected point or merely the intersection type.

Parameters
line:LineSegment
 
returnPoint:Boolean

Returns
*
getIntersectionPoint()method 
public function getIntersectionPoint(line:LineSegment):Point

Return the point at which the other line intersects us.

Parameters
line:LineSegment

Returns
Point
getIntersectionType()method 
public function getIntersectionType(line:LineSegment):int

Tests if the given line intersects this line. This method rotates both lines so that the start point of this line is on the left, at (0, 0). If the lines do intersect, it then returns INTERSECTION_NORTH if the end point of line is north of this line, INTERSECTION_SOUTH otherwise. Intersections are inclusive. If one or both points lands on this line, interects will not return DOES_NOT_INTERSECT.

Parameters
line:LineSegment

Returns
int
getLength()method 
public function getLength():Number

Get the length of this line.

Returns
Number
isIntersected()method 
public function isIntersected(line:LineSegment):BooleanParameters
line:LineSegment

Returns
Boolean
Constant detail
DOES_NOT_INTERSECTconstant
public static const DOES_NOT_INTERSECT:int = 3
INTERSECTION_NORTHconstant 
public static const INTERSECTION_NORTH:int = 1
INTERSECTION_SOUTHconstant 
public static const INTERSECTION_SOUTH:int = 2