Packagecom.yworks.yfiles.geom
Classpublic class YCircle
InheritanceYCircle Inheritance YObject Inheritance Object
Implements Comparable

This class represents a circle in the plane. A circle is defined by its center point and its radius.



Public Properties
 PropertyDefined By
  center : YPoint
[read-only] Returns the center of the circle.
YCircle
  radius : Number
[read-only] Returns the radius of the circle.
YCircle
Public Methods
 MethodDefined By
  
YCircle(radius:Number, init:Boolean = true)
Instantiates a circle with center location (0,0) and given radius.
YCircle
  
compareTo(o:Object):int
YCircle
  
equals(o:Object):Boolean
[override]
YCircle
  
getClass():Class
[override]
YCircle
  
getCut(line:AffineLine):Vector.<Object>
Determines the intersection between this circle and a line.
YCircle
  
getRectCut(corner:YPoint, size:YDimension):Vector.<Object>
Returns the intersection points of the circle with a rectangle.
YCircle
  
getXCut(y:Number):Vector.<Object>
Determine the intersection between the circle and a parallel to the X-Axis.
YCircle
  
getYCut(x:Number):Vector.<Object>
Determine the intersection between the circle and a parallel to the Y-Axis.
YCircle
  
hashCode():int
[override]
YCircle
  
newYCircle1(radius:Number):YCircle
[static] Instantiates a circle with center location (0,0) and given radius.
YCircle
  
newYCircle2(center:YPoint, radius:Number):YCircle
[static] Returns a circle defined by its center and the radius.
YCircle
  
newYCircle3(prevPoint:YPoint, succPoint:YPoint, radius:Number):YCircle
[static] Instantiates a circle defined by two points on its boundary and the radius.
YCircle
  
[static] Instantiates a circle defined by three points on its boundary.
YCircle
Protected Methods
 MethodDefined By
  
initYCircle1(radius:Number):void
Initializes this object.
YCircle
  
initYCircle2(center:YPoint, radius:Number):void
Initializes this object.
YCircle
  
initYCircle3(prevPoint:YPoint, succPoint:YPoint, radius:Number):void
Initializes this object.
YCircle
  
Initializes this object.
YCircle
Property Detail
centerproperty
center:YPoint  [read-only]

Returns the center of the circle.


Implementation
    public function get center():YPoint
radiusproperty 
radius:Number  [read-only]

Returns the radius of the circle.


Implementation
    public function get radius():Number
Constructor Detail
YCircle()Constructor
public function YCircle(radius:Number, init:Boolean = true)

Instantiates a circle with center location (0,0) and given radius.

Parameters
radius:Number
 
init:Boolean (default = true) — An internally used switch to help handle proper instance initialization in inheritance chains where classes can have multiple constructor-like factory methods. This parameter can safely be ignored/omitted when calling the constructor.
Method Detail
compareTo()method
public function compareTo(o:Object):int

Parameters

o:Object

Returns
int
equals()method 
override public function equals(o:Object):Boolean

Parameters

o:Object

Returns
Boolean
getClass()method 
override public function getClass():Class

Returns
Class
getCut()method 
public function getCut(line:AffineLine):Vector.<Object>

Determines the intersection between this circle and a line.

Parameters

line:AffineLine

Returns
Vector.<Object>
getRectCut()method 
public function getRectCut(corner:YPoint, size:YDimension):Vector.<Object>

Returns the intersection points of the circle with a rectangle. If there are two intersection points, the result is ordered. Then the first point in the result is the intersection point encountered when going from the center in ccw order around the circle.

Parameters

corner:YPoint — the upper left corner of the rectangle
 
size:YDimension — the size of the rectangle

Returns
Vector.<Object> — the points intersecting the rectangle or null if there are no intersection points.
getXCut()method 
public function getXCut(y:Number):Vector.<Object>

Determine the intersection between the circle and a parallel to the X-Axis.

Parameters

y:Number — y coordinate of the parallel.

Returns
Vector.<Object>
getYCut()method 
public function getYCut(x:Number):Vector.<Object>

Determine the intersection between the circle and a parallel to the Y-Axis.

Parameters

x:Number — x coordinate of the parallel.

Returns
Vector.<Object>
hashCode()method 
override public function hashCode():int

Returns
int
initYCircle1()method 
protected final function initYCircle1(radius:Number):void

Initializes this object. See the documentation of the corresponding factory method newYCircle1() for details.

Parameters

radius:Number

See also

initYCircle2()method 
protected final function initYCircle2(center:YPoint, radius:Number):void

Initializes this object. See the documentation of the corresponding factory method newYCircle2() for details.

Parameters

center:YPoint
 
radius:Number

See also

initYCircle3()method 
protected final function initYCircle3(prevPoint:YPoint, succPoint:YPoint, radius:Number):void

Initializes this object. See the documentation of the corresponding factory method newYCircle3() for details.

Parameters

prevPoint:YPoint
 
succPoint:YPoint
 
radius:Number

See also

initYCircle4()method 
protected final function initYCircle4(p:YPoint, q:YPoint, r:YPoint):void

Initializes this object. See the documentation of the corresponding factory method newYCircle4() for details.

Parameters

p:YPoint
 
q:YPoint
 
r:YPoint

See also

newYCircle1()method 
public static function newYCircle1(radius:Number):YCircle

Instantiates a circle with center location (0,0) and given radius.

Parameters

radius:Number

Returns
YCircle
newYCircle2()method 
public static function newYCircle2(center:YPoint, radius:Number):YCircle

Returns a circle defined by its center and the radius.

Parameters

center:YPoint
 
radius:Number

Returns
YCircle
newYCircle3()method 
public static function newYCircle3(prevPoint:YPoint, succPoint:YPoint, radius:Number):YCircle

Instantiates a circle defined by two points on its boundary and the radius.

Parameters

prevPoint:YPoint
 
succPoint:YPoint
 
radius:Number

Returns
YCircle
newYCircle4()method 
public static function newYCircle4(p:YPoint, q:YPoint, r:YPoint):YCircle

Instantiates a circle defined by three points on its boundary.

Parameters

p:YPoint
 
q:YPoint
 
r:YPoint

Returns
YCircle

Throws
IllegalArgumentException — if the points are collinear