Class Square
Extends
JXG.Composition.
A square is a rectangle with four sides each of the same length.
Defined in: Square.js.
Constructor Attributes | Constructor Name and Description |
---|---|
Square(p1,p2)
|
Field Attributes | Field Name and Description |
---|---|
Contains the square's stroke lines.
|
|
Contains the square's points.
|
- Methods borrowed from class JXG.Composition:
- add, highlight, noHighlight, prepareUpdate, remove, setProperty, update, updateRenderer
Class Detail
Square(p1,p2)
var p1 = board.create('point', [2.0, 2.0]), p2 = board.create('point', [1.0, 0.5]), a = board.create('square', [p1, p2]);
- Parameters:
- {JXG.Point_JXG.Point} p1,p2
- To build the square two additional points will be created. Those will be placed at a pi/2 rotation of the two given points around the center of the square.
- Throws:
- {Error}
- If the element cannot be constructed with the given parent objects an exception is thrown.
Field Detail
{Array}
lines
Contains the square's stroke lines. The first line is the one from the point 1 to point 3, the second line
the one from point 1 to point 4. The same with the third and the fourth line but with point 2 instead of
point 1. The order of the points is the same as in Square#points.
{Array}
points
Contains the square's points. The first two points are the ones given as parent elements by the user.
The third and the fourth point are a rotation of pi/2 of the first resp. the second point around the
center of the square.