Point
The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.
Can be created using method new:
Lib.Media.Geom.Point.new(x, y) |
Creates a new point. |
x - (default = 0) - The horizontal coordinate. y - (default = 0) - The vertical coordinate. |
Created Point object has properties:
length |
[read-only] The length of the line segment from (0,0) to this point. |
x |
The horizontal coordinate of the point. |
y |
The vertical coordinate of the point. |
methods:
add(v) |
Adds the coordinates of another point to the coordinates of this point to create a new point. |
v - The point to be added. |
clone() |
Creates a copy of this Point object. |
|
copyFrom(sourcePoint) |
Copies all of the point data from the source Point object into the calling Point object. |
sourcePoint - The Point object from which to copy the data. |
distance(pt1, pt2) |
[static] Returns the distance between pt1 and pt2. |
pt1 - The first point. pt2 - The second point. |
equals(toCompare) |
Determines whether two points are equal. |
toCompare - The point to be compared. |
interpolate(pt1, pt2, f) |
[static] Determines a point between two specified points. |
pt1 - The first point. pt2 - The second point. f - The level of interpolation between the two points. Indicates where the new point will be, along the line between pt1 and pt2. If f=1, pt1 is returned; if f=0, pt2 is returned. |
normalize(thickness) |
Scales the line segment between (0,0) and the current point to a set length. |
thickness - The scaling value. For example, if the current point is (0,5), and you normalize it to 1, the point returned is at (0,1). |
offset(dx, dy) |
Offsets the Point object by the specified amount. |
dx - The amount by which to offset the horizontal coordinate, x. dy - The amount by which to offset the vertical coordinate, y. |
polar(len, angle) |
[static] Converts a pair of polar coordinates to a Cartesian point coordinate. |
len - The length coordinate of the polar pair. angle - The angle, in radians, of the polar pair. |
setTo(xa, ya) |
Sets the members of Point to the specified values |
xa - the values to set the point to. ya |
subtract(v) |
Subtracts the coordinates of another point from the coordinates of this point to create a new point. |
v - The point to be subtracted. |
toString() |
Returns a string that contains the values of the x and y coordinates. |
|
Created with the Personal Edition of HelpNDoc: Single source CHM, PDF, DOC and HTML Help creation