Package | com.yworks.yfiles.geom |
Class | public class YPoint |
Inheritance | YPoint YObject Object |
Implements | Comparable |
Property | Defined By | ||
---|---|---|---|
x : Number [read-only]
Returns the x-coordinate of the point object. | YPoint | ||
y : Number [read-only]
Returns the y-coordinate of the point object. | YPoint |
Method | Defined By | ||
---|---|---|---|
YPoint(x:Number, y:Number, init:Boolean = true)
Creates a new YPoint object for a given position. | YPoint | ||
[static]
Adds two points and returns the result. | YPoint | ||
compareTo(o:Object):int
Comparable implementation. | YPoint | ||
[static]
Returns the euclidean distance between two points. | YPoint | ||
distance2(x1:Number, y1:Number, x2:Number, y2:Number):Number [static]
Returns the euclidean distance between two points. | YPoint | ||
distanceTo(p:YPoint):Number
Returns the euclidean distance between this point and a given point. | YPoint | ||
distanceTo2(x:Number, y:Number):Number
Returns the euclidean distance between this point and a given point. | YPoint | ||
equals(o:Object):Boolean [override]
Tests a point to equality to another point. | YPoint | ||
getClass():Class [override] | YPoint | ||
hashCode():int [override] | YPoint | ||
[static]
Returns a point that geometrically lies in in the middle of the line formed by the given points. | YPoint | ||
Returns the point, got by moving this point to another position. | YPoint | ||
[static]
Creates a new YPoint at location (0,0)
| YPoint | ||
newYPoint2(x:Number, y:Number):YPoint [static]
Creates a new YPoint object for a given position. | YPoint | ||
[static]
Subtracts two points (p1 - p2) and returns the result. | YPoint | ||
[static]
Returns a copy of the given point with exchanged x- and y-coordinates. | YPoint | ||
toString():String
Returns the coordinates of the point as string. | YPoint |
Method | Defined By | ||
---|---|---|---|
initYPoint1():void
Initializes this object. | YPoint | ||
initYPoint2(x:Number, y:Number):void
Initializes this object. | YPoint |
Constant | Defined By | ||
---|---|---|---|
ORIGIN : YPoint [static]
A YPoint constant with coordinates (0,0). | YPoint |
x | property |
x:Number
[read-only] Returns the x-coordinate of the point object.
public function get x():Number
y | property |
y:Number
[read-only] Returns the y-coordinate of the point object.
public function get y():Number
YPoint | () | Constructor |
public function YPoint(x:Number, y:Number, init:Boolean = true)
Creates a new YPoint object for a given position.
Parametersx:Number — the x coordinate of the point.
| |
y:Number — the y coordinate of the point.
| |
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.
|
add | () | method |
public static function add(p1:YPoint, p2:YPoint):YPoint
Adds two points and returns the result.
Parameters
p1:YPoint — an arbitrary instance of YPoint.
| |
p2:YPoint — an arbitrary instance of YPoint.
|
YPoint |
compareTo | () | method |
public function compareTo(o:Object):int
Comparable implementation. YPoints are ordered by ascending x-coordinates. If the x-coordinates of two points equal, then these points are ordered by ascending y-coordinates.
Parameters
o:Object |
int |
distance | () | method |
public static function distance(p1:YPoint, p2:YPoint):Number
Returns the euclidean distance between two points.
Parameters
p1:YPoint — an arbitrary point
| |
p2:YPoint — an arbitrary point
|
Number — the Euclidean distance between p1 and p2.
|
distance2 | () | method |
public static function distance2(x1:Number, y1:Number, x2:Number, y2:Number):Number
Returns the euclidean distance between two points.
Parameters
x1:Number — x-coordinate of first point
| |
y1:Number — y-coordinate of first point
| |
x2:Number — x-coordinate of second point
| |
y2:Number — y-coordinate of second point
|
Number — the euclidean distance between first and second point
|
distanceTo | () | method |
public function distanceTo(p:YPoint):Number
Returns the euclidean distance between this point and a given point.
Parameters
p:YPoint — an arbitrary point
|
Number — the Euclidean distance between this point and p.
|
distanceTo2 | () | method |
public function distanceTo2(x:Number, y:Number):Number
Returns the euclidean distance between this point and a given point.
Parameters
x:Number — the x coordinate of an arbitrary point
| |
y:Number — the y coordinate of an arbitrary point
|
Number — the Euclidean distance between this point and the point (x,y).
|
equals | () | method |
override public function equals(o:Object):Boolean
Tests a point to equality to another point.
This test returns true if the o
is also an instance of YPoint and has the same coordinates as the instance on which equals is invoked.
Parameters
o:Object — an arbitrary instance.
|
Boolean |
getClass | () | method |
override public function getClass():Class
ReturnsClass |
hashCode | () | method |
override public function hashCode():int
Returnsint |
initYPoint1 | () | method |
protected final function initYPoint1():void
Initializes this object. See the documentation of the corresponding factory method newYPoint1()
for details.
See also
initYPoint2 | () | method |
protected final function initYPoint2(x:Number, y:Number):void
Initializes this object. See the documentation of the corresponding factory method newYPoint2()
for details.
Parameters
x:Number | |
y:Number |
See also
midPoint | () | method |
public static function midPoint(p1:YPoint, p2:YPoint):YPoint
Returns a point that geometrically lies in in the middle of the line formed by the given points.
Parameters
p1:YPoint — an arbitrary instance of YPoint.
| |
p2:YPoint — an arbitrary instance of YPoint.
|
YPoint |
moveBy | () | method |
public function moveBy(x:Number, y:Number):YPoint
Returns the point, got by moving this point to another position.
Parameters
x:Number — the value which is added on the x-coordinate of the point.
| |
y:Number — the value which is added on the y-coordinate of the point.
|
YPoint — a new instance of YPoint which is the result of the moving operation.
|
newYPoint1 | () | method |
newYPoint2 | () | method |
public static function newYPoint2(x:Number, y:Number):YPoint
Creates a new YPoint object for a given position.
Parameters
x:Number — the x coordinate of the point.
| |
y:Number — the y coordinate of the point.
|
YPoint |
subtract | () | method |
public static function subtract(p1:YPoint, p2:YPoint):YPoint
Subtracts two points (p1 - p2) and returns the result.
Parameters
p1:YPoint — an arbitrary instance of YPoint.
| |
p2:YPoint — an arbitrary instance of YPoint.
|
YPoint |
swap | () | method |
public static function swap(p:YPoint):YPoint
Returns a copy of the given point with exchanged x- and y-coordinates.
Parameters
p:YPoint — an arbitrary instance of YPoint.
|
YPoint |
toString | () | method |
public function toString():String
Returns the coordinates of the point as string.
ReturnsString |
ORIGIN | Constant |
public static const ORIGIN:YPoint
A YPoint constant with coordinates (0,0).