Class: Point2d

RaphaelTools. Point2d

represents points in 2d xy plane

new Point2d(x, y)

2d xy plane point implementation
This:
Parameters:
Name Type Argument Description
x number <optional>
x coordinate of point
y number <optional>
y coordinate of point
Properties:
Name Type Description
x number x coordinate
y number y coordinate
copies Array.<RaphaelTools.Point2d> array of copies of itself
copiesShifts Array.<Array.<number>> array of 2 element arrays, horizontal and verical shifts of copies from receiver
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 244

Methods

<static> create(x, y) → {RaphaelTools.Point2d}

Creates new Point2d object, for parameters meaning see RaphaelTools.Point2d
Parameters:
Name Type Argument Description
x number <optional>
y number <optional>
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 334
Returns:
new Point2d object
Type
RaphaelTools.Point2d

copy(shifts)

Copy receiver to given positions
Parameters:
Name Type Description
shifts Array.<Array.<number>> array of 2 element arrays, vertical and horizontal shifts of copied points
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 263
Example
n = RaphaelTools.Point2d(100,150);
shifts=[[100,200],[200,200],[100,300],[200,300]]

setX(x)

Set new x coordinate to receiver
Parameters:
Name Type Description
x x coordinate of new position
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 283

setXY(x, y)

Sets new position to receiver
Parameters:
Name Type Description
x number x coordinate of new position
y number y coordinate of new position
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 274

setY(y)

Set new y coordinate to receiver
Parameters:
Name Type Description
y y coordinate of new position
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 291

toString() → {string}

String representation
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 254
Returns:
string representation
Type
string

translate(dx, dy)

Change position of receiver by given values
Parameters:
Name Type Description
dx number length of translation in x direction
dy number length of translation in y direction
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 300

translateX(dx)

Change horizontal position of receiver by given values
Parameters:
Name Type Description
dx number length of translation in x direction
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 309

translateY(dy)

Change vertical position of receiver by given values
Parameters:
Name Type Description
dy number length of translation in x direction
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 316

update()

Update receiver (change positions of stored copies so as stored shifts between receiver and its copies remain constant
Source:
  • /var/www/html/software/raphaeltools/raphaeltools.src.js, line 322