API Docs for: 0.99.4
Show:

# PSEUDO

Extends JXG.Line
Module: JXG

This element is used to provide a constructor for the polar line of a point with respect to a conic or a circle.

The polar line is the unique reciprocal relationship of a point with respect to a conic. The lines through the intersections of a conic and the polar line of a point with respect to that conic and through that point are tangent to the conic. A point on a conic has the polar line of that point with respect to that conic as the tangent line to that conic at that point. See undefined for more information on pole and polar.

## Constructor

### `PolarLine`

(
• `el1,el2`
• `el1,el2`
)

#### Parameters:

• `el1,el2` JXG.Conic,JXG.Circle_JXG.Point

or

• `el1,el2` JXG.Point_JXG.Conic,JXG.Circle

The result will be the polar line of the point with respect to the conic or the circle.

#### Throws:

Exception:

If the element cannot be constructed with the given parent objects an exception is thrown.

#### Example:

``````// Create the polar line of a point with respect to a conic
var p1 = board.create('point', [-1, 2]);
var p2 = board.create('point', [ 1, 4]);
var p3 = board.create('point', [-1,-2]);
var p4 = board.create('point', [ 0, 0]);
var p5 = board.create('point', [ 4,-2]);
var c1 = board.create('conic',[p1,p2,p3,p4,p5]);
var p6 = board.create('point', [-1, 1]);
var l1 = board.create('polarline', [c1, p6]);
``````
``````// Create the polar line of a point with respect to a circle.
var p1 = board.create('point', [ 1, 1]);
var p2 = board.create('point', [ 2, 3]);
var c1 = board.create('circle',[p1,p2]);
var p3 = board.create('point', [ 6, 6]);
var l1 = board.create('polarline', [c1, p3]);
``````

## Methods

### `_set`

(
• `property`
• `value`
)
private chainable

Sets the value of property property to value.

#### Parameters:

• `property` String

The property's name.

• `value` Object

The new value

### `addChild`

(
• `obj`
)
chainable

Add an element as a child to the current element. Can be used to model dependencies between geometry elements.

### `addDescendants`

(
• `obj`
)
private chainable

Adds the given object to the descendants list of this object and all its child objects.

#### Parameters:

• `obj` JXG.GeometryElement

The element that is to be added to the descendants list.

### `addParents`

(
• `parents`
)
JXG.Object chainable

Adds ids of elements to the array this.parents. This method needs to be called if some dependencies can not be detected automatically by JSXGraph. For example if a function graph is given by a function which referes to coordinates of a point, calling addParents() is necessary.

#### Parameters:

• `parents` Array

Array of elements or ids of elements. Alternatively, one can give a list of objects as parameters.

#### Returns:

JXG.Object:

reference to the object itself.

#### Example:

``````// Movable function graph
var A = board.create('point', [1, 0], {name:'A'}),
B = board.create('point', [3, 1], {name:'B'}),
f = board.create('functiongraph', function(x) {
var ax = A.X(),
ay = A.Y(),
bx = B.X(),
by = B.Y(),
a = (by - ay) / ( (bx - ax) * (bx - ax) );
return a * (x - ax) * (x - ax) + ay;
}, {fixed: false});
``````

### `addRotation`

(
• `angle`
)
chainable

Rotate texts or images by a given degree. Works only for texts where JXG.Text#display equal to "internal".

#### Parameters:

• `angle` Number

The degree of the rotation (90 means vertical text).

• JXG.GeometryElement#rotate

### `addTicks`

(
• `ticks`
)

Adds ticks to this line. Ticks can be added to any kind of line: line, arrow, and axis.

#### Parameters:

• `ticks` JXG.Ticks

Reference to a ticks object which is describing the ticks (color, distance, how many, etc.).

#### Returns:

String:

Id of the ticks object.

### `addTransform`

(
• `transform`
)
chainable

Add transformations to this line.

#### Parameters:

• `transform`

Either one {@link JXG.Transformation} or an array of {@link JXG.Transformation}s.

#### Returns:

JXG.Line:

Reference to this line object.

### `animate`

(
• `hash`
• `time`
• `[options]`
)
chainable

Animates properties for that object like stroke or fill color, opacity and maybe even more later.

#### Parameters:

• `hash` Object

Object containing properties with target values for the animation.

• `time` Number

Number of milliseconds to complete the animation.

• `[options]` Object optional

Optional settings for the animation:

• callback: A function that is called as soon as the animation is finished.

#### Returns:

JXG.GeometryElement:

A reference to the object

### `bounds`

()

Dimensions of the smallest rectangle enclosing the element.

#### Returns:

Array:

The coordinates of the enclosing rectangle in a format like the bounding box in {@link JXG.Board#setBoundingBox}.

### `clearTrace`

() chainable

Removes all objects generated by the trace function.

### `cloneToBackground`

() chainable

Copy the element to background. This is used for tracing elements.

### `countChildren`

() private

Counts the direct children of an object without counting labels.

#### Returns:

Number:

Number of children

### `createGradient`

() private chainable

Creates a gradient nodes in the renderer.

### `createLabel`

() chainable

Creates a label element for this geometry element.

### `dash`

(
• `d`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1703`

Deprecated: Use {@link #setAttribute}

Set the dash type of an element

#### Parameters:

• `d` Number

Integer which determines the way of dashing an element's outline.

### `draggable`

() private

Decides whether an element can be dragged. This is used in JXG.GeometryElement#setPositionDirectly methods where all parent elements are checked if they may be dragged, too.

### `fillColor`

(
• `fColor`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1657`

Deprecated: Use {@link #setAttribute}

Set the fillColor of an element

#### Parameters:

• `fColor` String

String which determines the fill color of an object.

### `generatePolynomial`

(
• `p`
)
private

Used to generate a polynomial for a point p that lies on this line, i.e. p is collinear to undefined and undefined.

#### Parameters:

• `p` JXG.Point

The point for that the polynomial is generated.

#### Returns:

Array:

An array containing the generated polynomial.

### `getAngle`

()

Determines the angle in Radians between the positive x axis and the line.

Number:

### `getAttribute`

(
• `key`
)

Get the value of the property key.

#### Parameters:

• `key` String

The name of the property you are looking for

#### Returns:

The value of the property

### `getAttributes`

()

Retrieve a copy of the current visProp.

### `getLabelAnchor`

()

Returns the coords object where the label of the element shall be drawn. Differs in some cases from the values that getTextAnchor returns.

#### Returns:

JXG.Coords:

JXG.Coords Place where the text shall be drawn.

### `getName`

()

Returns the elements name, used in JessieCode.

### `getParents`

()

List of the element ids resp. values used as parents in JXG.Board#create.

### `getProperty`

() deprecated

Inherited from JXG.GeometryElement: `src/base/element.js:1237`

Deprecated: Use {@link JXG.GeometryElement#getAttribute}.

Deprecated alias for JXG.GeometryElement#getAttribute.

### `getRise`

()

Calculates the y intersect of the line.

Number:

The y intersect.

### `getSlope`

()

Calculates the slope of the line.

#### Returns:

Number:

The slope of the line or Infinity if the line is parallel to the y-axis.

### `getTextAnchor`

()

Returns the coords object where a text that is bound to the element shall be drawn. Differs in some cases from the values that getLabelAnchor returns.

#### Returns:

JXG.Coords:

JXG.Coords Place where the text shall be drawn.

### `getTpye`

()

The type of the element as used in JXG.Board#create.

### `handleSnapToGrid`

(
• `force`
)
chainable

Move an element to its nearest grid point. The function uses the coords object of the element as its actual position. If there is no coords object, nothing is done.

#### Parameters:

• `force` Boolean

force snapping independent from what the snaptogrid attribute says

#### Returns:

JXG.GeometryElement:

Reference to this element

### `hasPoint`

(
• `x`
• `y`
)

Checks whether (x,y) is near the line.

#### Parameters:

• `x` Number

Coordinate in x direction, screen coordinates.

• `y` Number

Coordinate in y direction, screen coordinates.

#### Returns:

Boolean:

True if (x,y) is near the line, False otherwise.

### `hideElement`

() chainable

Hide the element. It will still exist but not visible on the board.

### `highlight`

(
• `[force=false]`
)
chainable

Highlights the element.

#### Parameters:

• `[force=false]` Boolean optional

Force the highlighting

### `highlightFillColor`

(
• `fColor`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1673`

Deprecated: Use {@link #setAttribute}

Set the highlightFillColor of an element

#### Parameters:

• `fColor` String

String which determines the fill color of an object when its highlighted.

### `highlightStrokeColor`

(
• `sColor`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1611`

Deprecated: Use {@link #setAttribute}

Set the highlightStrokeColor of an element

#### Parameters:

• `sColor` String

String which determines the stroke color of an object when its highlighted.

### `L`

()

The distance between the two points defining the line.

### `labelColor`

(
• `lColor`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1688`

Deprecated: Use {@link #setAttribute}

Set the labelColor of an element

#### Parameters:

• `lColor` String

String which determines the text color of an object's label.

### `maxX`

() private

Treat the element as parametric curve

Number:

1.0

### `minX`

() private

Treat the element as a parametric curve

Number:

0.0

### `noHighlight`

() chainable

Uses the "normal" properties of the element.

### `normalize`

() private chainable

Normalize the element's standard form.

### `prepareUpdate`

() private chainable

Notify all child elements for updates.

### `remove`

() chainable

Removes the element from the construction. This only removes the SVG or VML node of the element and its label (if available) from the renderer, to remove the element completely you should use JXG.Board#removeObject.

### `removeAllTicks`

() chainable

Removes all ticks from a line.

### `removeChild`

(
• `obj`
)
chainable

Remove an element as a child from the current element.

### `removeDescendants`

(
• `obj`
)
private chainable

Removes the given object from the descendants list of this object and all its child objects.

#### Parameters:

• `obj` JXG.GeometryElement

The element that is to be removed from the descendants list.

### `resolveShortcuts`

(
• `properties`
)

Resolves property shortcuts like color and expands them, e.g. strokeColor and fillColor. Writes the expanded properties back to the given properties.

#### Parameters:

• `properties` Object

#### Returns:

Object:

The given parameter with shortcuts expanded.

### `rmoveTicks`

(
• `tick`
)
chainable

Removes ticks identified by parameter named tick from this line.

#### Parameters:

• `tick` JXG.Ticks

Reference to tick object to remove.

### `setArrow`

(
• `firstArrow`
• `lastArrow`
)
chainable

Determines whether the element has arrows at start or end of the arc.

#### Parameters:

• `firstArrow` Boolean

True if there is an arrow at the start of the arc, false otherwise.

• `lastArrow` Boolean

True if there is an arrow at the end of the arc, false otherwise.

### `setAttribute`

(
• `attributes`
)
chainable

Sets an arbitrary number of attributes.

#### Parameters:

• `attributes` Object

An object with attributes.

#### Example:

``````// Set property directly on creation of an element using the attributes object parameter
var board = JXG.JSXGraph.initBoard('jxgbox', {boundingbox: [-1, 5, 5, 1]};
var p = board.create('point', [2, 2], {visible: false});

// Now make this point visible and fixed:
p.setAttribute({
fixed: true,
visible: true
});``````

### `setDash`

(
• `dash`
)
private chainable

Set the dash style of an object. See undefined for a list of available dash styles. You should use undefined instead of this method.

#### Parameters:

• `dash` Number

Indicates the new dash style

### `setLabel`

(
• `str`
)
chainable

Sets a label and it's text If label doesn't exist, it creates one

### `setLabelRelativeCoords`

() private

Adjusts Label coords relative to Anchor. DESCRIPTION

### `setLabelText`

(
• `str`
)
chainable

Updates the element's label text, strips all html.

### `setName`

(
• `str`
)
chainable

Updates the element's label text and the element's attribute "name", strips all html.

### `setParents`

(
• `parents`
)
JXG.Object chainable

Sets ids of elements to the array this.parents. First, this.parents is cleared. See undefined.

#### Parameters:

• `parents` Array

Array of elements or ids of elements. Alternatively, one can give a list of objects as parameters.

#### Returns:

JXG.Object:

reference to the object itself.

### `setPosition`

(
• `method`
• `coords`
)
chainable

Translates the object by (x, y). In case the element is defined by points, the defining points are translated, e.g. a circle constructed by a center point and a point on the circle line.

#### Parameters:

• `method` Number

The type of coordinates used here. Possible values are {@link JXG.COORDS_BY_USER} and {@link JXG.COORDS_BY_SCREEN}.

• `coords` Array

array of translation vector.

#### Returns:

JXG.GeometryElement:

Reference to the element object.

### `setPositionDirectly`

(
• `method`
• `coords`
• `oldcoords`
)
chainable

Moves an by the difference of two coordinates.

#### Parameters:

• `method` Number

The type of coordinates used here. Possible values are {@link JXG.COORDS_BY_USER} and {@link JXG.COORDS_BY_SCREEN}.

• `coords` Array

coordinates in screen/user units

• `oldcoords` Array

previous coordinates in screen/user units

#### Returns:

JXG.GeometryElement:

this element

### `setProperty`

() deprecated

Inherited from JXG.GeometryElement: `src/base/element.js:1030`

Deprecated: Use {@link JXG.GeometryElement#setAttribute}.

Deprecated alias for JXG.GeometryElement#setAttribute.

### `setStraight`

(
• `straightFirst`
• `straightLast`
)
private

Determines whether the line is drawn beyond undefined and undefined and updates the line.

#### Parameters:

• `straightFirst` Boolean

True if the Line shall be drawn beyond {@link #point1}, false otherwise.

• `straightLast` Boolean

True if the Line shall be drawn beyond {@link #point2}, false otherwise.

• #straightFirst
• #straightLast

### `shadow`

(
• `s`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1733`

Deprecated: Use {@link #setAttribute}

Set the shadow of an element

#### Parameters:

• `s` Boolean

Boolean which determines whether the element has a shadow or not.

### `showElement`

() chainable

Make the element visible.

### `snapToGrid`

() chainable

Snaps the element to the grid. Only works for points, lines and circles. Points will snap to the grid as defined in their properties undefined and undefined. Lines and circles will snap their parent points to the grid, if they have undefined set to true.

#### Returns:

JXG.GeometryElement:

Reference to the element.

### `snapToPoints`

() chainable

Snaps the element to points. Only works for points. Points will snap to the next point as defined in their properties undefined and undefined. Lines and circles will snap their parent points to points.

#### Returns:

JXG.GeometryElement:

Reference to the element.

### `strokeColor`

(
• `sColor`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1626`

Deprecated: Use {@link #setAttribute}

Set the strokeColor of an element

#### Parameters:

• `sColor` String

String which determines the stroke color of an object.

### `strokeWidth`

(
• `width`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1641`

Deprecated: Use {@link #setAttribute}

Set the strokeWidth of an element

#### Parameters:

• `width` Number

Integer which determines the stroke width of an outline.

### `toJSON`

() private

EXPERIMENTAL. Generate JSON object code of visProp and other properties.

#### Returns:

JSON string containing element's properties.

### `update`

() chainable

Update method. Position and content of the element are updated. The element is redrawn by a subsequent call of {@see #updateRenderer}. Can be used sometimes to commit changes to the object.

### `updateRenderer`

() private chainable

Uses the boards renderer to update the line.

### `updateSegmentFixedLength`

() private chainable

Update segments with fixed length and at least one movable point.

### `updateStdform`

() private chainable

Updates the stdform derived from the parent point positions.

### `visible`

(
• `v`
)
deprecated chainable

Inherited from JXG.GeometryElement: `src/base/element.js:1718`

Deprecated: Use {@link #setAttribute}

Set the visibility of an element

#### Parameters:

• `v` Boolean

Boolean which determines whether the element is drawn.

### `X`

(
• `t`
)

Treat the line as parametric curve in homogeneous coordinates, where the parameter t runs from 0 to 1. First we transform the interval [0,1] to [-1,1]. If the line has homogeneous coordinates [c,a,b] = stdform[] then the direction of the line is [b,-a]. Now, we take one finite point that defines the line, i.e. we take either point1 or point2 (in case the line is not the ideal line). Let the coordinates of that point be [z, x, y]. Then, the curve runs linearly from [0, b, -a] (t=-1) to [z, x, y] (t=0) and [z, x, y] (t=0) to [0, -b, a] (t=1)

#### Parameters:

• `t` Number

Parameter running from 0 to 1.

#### Returns:

Number:

X(t) x-coordinate of the line treated as parametric curve.

### `Y`

(
• `t`
)

Treat the line as parametric curve in homogeneous coordinates. See undefined for a detailed description.

#### Parameters:

• `t` Number

Parameter running from 0 to 1.

#### Returns:

Number:

Y(t) y-coordinate of the line treated as parametric curve.

### `Z`

(
• `t`
)

Treat the line as parametric curve in homogeneous coordinates. See undefined for a detailed description.

#### Parameters:

• `t` Number

Parameter running from 0 to 1.

#### Returns:

Number:

Z(t) z-coordinate of the line treated as parametric curve.

## Properties

### `_org_type`

Number final

Original type of the element at construction time. Used for removing glider property.

### `_pos`

Number private

The position of this element inside the undefined.

Default: -1

### `ancestors`

Object

Elements on which this element depends on are stored here.

### `baseElement`

JXG.GeometryElement private

Default: null

### `board`

JXG.Board

Reference to the board associated with the element.

### `childElements`

Object

Stores all dependent objects to be updated when this point is moved.

### `defaultTicks`

JXG.Ticks

Reference of the ticks created automatically when constructing an axis.

### `descendants`

Object

Elements depending on this element are stored here.

### `dump`

Boolean

The element is saved with an explicit entry in the file (true) or implicitly via a composition.

Default: true

### `elementClass`

Number final

The element's class.

### `elType`

String

The string used with JXG.Board#create

### `hasLabel`

Boolean

If element has a label subelement then this property will be set to true.

Default: false

### `highlighted`

Boolean

True, if the element is currently highlighted.

Default: false

### `id`

String

Unique identifier for the element. Equivalent to id-attribute of renderer element.

### `isDraggable`

Boolean

Controls if this element can be dragged. In GEONExT only free points and gliders can be dragged.

Default: false

### `isReal`

Boolean

If element is in two dimensional real space this is true, else false.

Default: true

### `lastDragTime`

Date

Time stamp containing the last time this element has been dragged.

Default: creation time

### `methodMap`

Object

The methodMap determines which methods can be called from within JessieCode and under which name it can be used. The map is saved in an object, the name of a property is the name of the method used in JessieCode, the value of a property is the name of the method in JavaScript.

### `mouseover`

Boolean

Is the mouse over this element?

Default: false

### `name`

String

Not necessarily unique name for the element.

Default: Name generated by {@link JXG.Board#generateName}.

### `needsUpdate`

Boolean

Controls if updates are necessary

Default: true

### `notExistingParents`

Object

Stores all Intersection Objects which in this moment are not real and so hide this element.

### `numTraces`

Number

Counts the number of objects drawn as part of the trace of the element.

### `parentPolygon`

JXG.Polygon private

If the line is the border of a polygon, the polygon object is stored, otherwise null.

Default: null

### `parents`

Object

Ids of elements on which this element depends directly are stored here.

### `point1`

JXG.Point

Startpoint of the line. You really should not set this field directly as it may break JSXGraph's udpate system so your construction won't be updated properly.

### `point2`

JXG.Point

Endpoint of the line. Just like undefined you shouldn't write this field directly.

### `quadraticform`

Array

Quadratic form representation of circles (and conics)

Default: [[1,0,0],[0,1,0],[0,0,1]]

### `rendNode`

Object

Stores the rendering node for the element.

### `stdform`

Array

[c,b0,b1,a,k,r,q0,q1]

See A.E. Middleditch, T.W. Stacey, and S.B. Tor: "Intersection Algorithms for Lines and Circles", ACM Transactions on Graphics, Vol. 8, 1, 1989, pp 25-40.

The meaning of the parameters is: Circle: points p=[p0,p1] on the circle fulfill a<p,p> + <b,p> + c = 0 For convenience we also store r: radius k: discriminant = sqrt(<b,b>-4ac) q=[q0,q1] center

Points have radius = 0. Lines have radius = infinity. b: normalized vector, representing the direction of the line.

Should be put into Coords, when all elements possess Coords.

Default: [1, 0, 0, 0, 1, 1, 0, 0]

### `subs`

Object

Subs contains the subelements, created during the create method.

### `symbolic`

Object

Stores variables for symbolic computations

### `ticks`

Array

Array of ticks storing all the ticks on this line. Do not set this field directly and use JXG.Line#addTicks and undefined to add and remove ticks to and from the line.

### `traces`

Object

Keeps track of all objects drawn as part of the trace of the element.

### `transformations`

Array

Stores the transformations which are applied during update in an array

### `type`

Number final

Type of the element.

### `visProp`

Object

An associative array containing all visual properties.

Default: empty object

## Events

### `attribute`

Notify everytime an attribute is changed.

• `o` Object

A list of changed attributes and their new value.

• `el` Object

Reference to the element

### `attribute:<attribute>`

This is a generic event handler. It exists for every possible attribute that can be set for any element, e.g. if you want to be notified everytime an element's strokecolor is changed, is the event attribute:strokecolor.

• `val` Object

The old value.

• `nval` Object

The new value

• `el` Object

Reference to the element

### `down`

Whenever the user starts to touch or click an element.

• `e` Event

The browser's event object.

### `drag`

This event is fired whenever the user drags an element.

• `e` Event

The browser's event object.

### `mousedown`

Whenever the user starts to click an element.

• `e` Event

The browser's event object.

### `mousedrag`

This event is fired whenever the user drags the element with a mouse.

• `e` Event

The browser's event object.

### `mousemove`

This event is fired whenever the user is moving the mouse over an element.

• `e` Event

The browser's event object.

### `mouseout`

This event is fired whenever the user puts the mouse away from an element.

• `e` Event

The browser's event object.

### `mouseover`

This event is fired whenever the user puts the mouse over an element.

• `e` Event

The browser's event object.

### `mouseup`

Whenever the user releases the mousebutton over an element.

• `e` Event

The browser's event object.

### `move`

This event is fired whenever the user is moving over an element.

• `e` Event

The browser's event object.

### `out`

This event is fired whenever the user is leaving an element.

• `e` Event

The browser's event object.

### `over`

This event is fired whenever the user is hovering over an element.

• `e` Event

The browser's event object.

### `touchdown`

Whenever the user starts to touch an element.

• `e` Event

The browser's event object.

### `touchdrag`

This event is fired whenever the user drags the element on a touch device.

• `e` Event

The browser's event object.

### `touchup`

Whenever the user stops touching an element.

• `e` Event

The browser's event object.

### `up`

Whenever the user stops to touch or click an element.

• `e` Event