Class Point2d
represents points in 2d xy plane
Defined in: raphaeltools.src.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Point2d(x, y)
2d xy plane point implementation
|
Field Attributes | Field Name and Description |
---|---|
array of copies of itself
|
|
horizontal and verical shifts of copies from receiver
|
|
x coordinate
|
|
y coordinate
|
Method Attributes | Method Name and Description |
---|---|
copy(shifts)
Copy receiver to given positions
|
|
<static> |
Point2d.create(x, y)
Creates new Point2d object, for parameters meaning see Point2d
|
setX(x)
Set new x coordinate to receiver
|
|
setXY(x, y)
Sets new position to receiver
|
|
setY(y)
Set new y coordinate to receiver
|
|
toString()
String representation
|
|
translate(dx, dy)
Change position of receiver by given values
|
|
translateX(dx)
Change horizontal position of receiver by given values
|
|
translateY(dy)
Change vertical position of receiver by given values
|
|
update()
Update receiver (change positions of stored copies so as stored shifts between receiver and its copies remain constant
|
Class Detail
Point2d(x, y)
2d xy plane point implementation
- Parameters:
- {float} x
- x coordinate of point
- {float} y
- y coordinate of point
Field Detail
{[Points2d]}
copies
array of copies of itself
{[[float|float]]}
copiesShifts
horizontal and verical shifts of copies from receiver
{float}
x
x coordinate
{float}
y
y coordinate
Method Detail
copy(shifts)
Copy receiver to given positions
n = Point2d(100,150); shifts=[[100,200],[200,200],[100,300],[200,300]]
- Parameters:
- {[[float|float]]} shifts
- vertical and horizontal shifts of copied points
<static>
{Point2d}
Point2d.create(x, y)
Creates new Point2d object, for parameters meaning see Point2d
- Parameters:
- x
- y
- Returns:
- {Point2d} new Point2d object
setX(x)
Set new x coordinate to receiver
- Parameters:
- x
- x coordinate of new position
setXY(x, y)
Sets new position to receiver
- Parameters:
- {float} x
- x coordinate of new position
- {float} y
- y coordinate of new position
setY(y)
Set new y coordinate to receiver
- Parameters:
- y
- y coordinate of new position
{String}
toString()
String representation
- Returns:
- {String} string representation
translate(dx, dy)
Change position of receiver by given values
- Parameters:
- {float} dx
- length of translation in x direction
- {float} dy
- length of translation in y direction
translateX(dx)
Change horizontal position of receiver by given values
- Parameters:
- {float} dx
- length of translation in x direction
translateY(dy)
Change vertical position of receiver by given values
- Parameters:
- {float} dy
- length of translation in x direction
update()
Update receiver (change positions of stored copies so as stored shifts between receiver and its copies remain constant