Packagecom.kapit.visualizer.Utils
Classpublic class GeomUtils



Public Methods
 MethodDefined by
  
GeomUtils
  
computeRotation(p0:Point, p1:Point):Number
[static]
GeomUtils
  
computeSegmentLength(source:Point, target:Point):Number
[static]
GeomUtils
  
getArrowCoordinates(sourcePoint:Point, targetPoint:Point, width:Number, height:Number, generateRectangle:Boolean = false):Array
[static]
GeomUtils
  
getNearestPoint(intersections:Array, sourcePoint:Point):Point
[static]
GeomUtils
  
intersectLineToLine(source1:Point, target1:Point, source2:Point, target2:Point):Point
[static] Calcultaes the intersection point between two segments.
GeomUtils
  
intersectLineToRectangle(source:Point, target:Point, rectangle:Rectangle):Array
[static] Computes intersections between a segment and a rectangle.
GeomUtils
Public Constants
 ConstantDefined by
  PIO2 : Number
[static] 90°
GeomUtils
  TWOPI : Number
[static] 360°
GeomUtils
Constructor detail
GeomUtils()constructor
public function GeomUtils()
Method detail
computeRotation()method
public static function computeRotation(p0:Point, p1:Point):NumberParameters
p0:Point
 
p1:Point

Returns
Number
computeSegmentLength()method 
public static function computeSegmentLength(source:Point, target:Point):NumberParameters
source:Point
 
target:Point

Returns
Number
getArrowCoordinates()method 
public static function getArrowCoordinates(sourcePoint:Point, targetPoint:Point, width:Number, height:Number, generateRectangle:Boolean = false):ArrayParameters
sourcePoint:Point
 
targetPoint:Point
 
width:Number
 
height:Number
 
generateRectangle:Boolean (default = false)

Returns
Array
getNearestPoint()method 
public static function getNearestPoint(intersections:Array, sourcePoint:Point):PointParameters
intersections:Array
 
sourcePoint:Point

Returns
Point
intersectLineToLine()method 
public static function intersectLineToLine(source1:Point, target1:Point, source2:Point, target2:Point):Point

Calcultaes the intersection point between two segments. The algorithm is trivial.

Parameters
source1:Point — First segment source point.
 
target1:Point — First segment target point.
 
source2:Point — Second segment source point.
 
target2:Point — Second segment target point.

Returns
Point

See also

intersectLineToRectangle()method 
public static function intersectLineToRectangle(source:Point, target:Point, rectangle:Rectangle):Array

Computes intersections between a segment and a rectangle.

Parameters
source:Point — source segment Point.
 
target:Point — target segment Point.
 
rectangle:Rectangle — Rectangle.

Returns
Array — Possible intersections.
Constant detail
PIO2constant
public static const PIO2:Number

90°

TWOPIconstant 
public static const TWOPI:Number

360°