# JSXGraph 1.11.1 Reference

## JavaScript must be enabled in order for you to use JSXGraph and JSXGraph reference. However, it seems JavaScript is either disabled or not supported by your browser.

Class Index | File Index

Elements

- Angle
- Arc
- Arrow
- Arrowparallel
- Axes3D
- Axis
- Axis3D
- Bisector
- Bisectorlines
- Boxplot
- Button
- Cardinalspline
- Chart
- Checkbox
- Circle
- Circle3D
- Circumcenter
- Circumcircle
- CircumcircleArc
- CircumcircleSector
- Comb
- Conic
- Curve
- Curve3D
- CurveDifference
- CurveIntersection
- CurveUnion
- Derivative
- Ellipse
- Face3D
- ForeignObject
- Functiongraph
- Functiongraph3D
- Glider
- Grid
- Group
- Hatch
- Hyperbola
- Image
- ImplicitCurve
- Incenter
- Incircle
- Inequality
- Input
- Integral
- Intersection
- IntersectionCircle3D
- IntersectionLine3D
- Label
- Legend
- Line
- Line3D
- MajorArc
- MajorSector
- Measurement
- Mesh3D
- Metapostspline
- Midpoint
- MinorArc
- MinorSector
- MirrorElement
- MirrorPoint
- NonReflexAngle
- Normal
- Orthogonalprojection
- OtherIntersection
- Parabola
- Parallel
- Parallelogram
- Parallelpoint
- ParametricSurface3D
- Perpendicular
- PerpendicularPoint
- PerpendicularSegment
- Plane3D
- Point
- Point3D
- PolarLine
- PolePoint
- Polygon
- Polygon3D
- PolygonalChain
- Polyhedron3D
- RadicalAxis
- Reflection
- ReflexAngle
- RegularPolygon
- Riemannsum
- Sector
- Segment
- Semicircle
- Slider
- Slopefield
- Slopetriangle
- Smartlabel
- Sphere3D
- Spline
- Stepfunction
- Tangent
- TangentTo
- Tapemeasure
- Text
- Text3D
- Ticks
- Ticks3D
- Tracecurve
- Transformation
- Transformation3D
- Turtle
- Vectorfield
- Vectorfield3D
- View3D

Classes

- _global_
- JXG
- JXG.AbstractRenderer
- JXG.Board
- JXG.Board.infobox
- JXG.C
- JXG.CA
- JXG.CanvasRenderer
- JXG.Chart
- JXG.Circle
- JXG.Circle3D
- JXG.Complex
- JXG.Composition
- JXG.Coords
- JXG.CoordsElement
- JXG.Curve
- JXG.Curve3D
- JXG.Dump
- JXG.EventEmitter
- JXG.Expect
- JXG.Face3D
- JXG.ForeignObject
- JXG.GeometryElement
- JXG.GeometryElement3D
- JXG.GeonextParser
- JXG.Group
- JXG.Image
- JXG.JessieCode
- JXG.JSXGraph
- JXG.Legend
- JXG.Line
- JXG.Line3D
- JXG.Math
- JXG.Math.BoxQuadtree
- JXG.Math.Clip
- JXG.Math.Extrapolate
- JXG.Math.Geometry
- JXG.Math.ImplicitPlot
- JXG.Math.IntervalArithmetic
- JXG.Math.Metapost
- JXG.Math.Nlp
- JXG.Math.Numerics
- JXG.Math.Plot
- JXG.Math.Poly
- JXG.Math.Poly.Monomial
- JXG.Math.Poly.Polynomial
- JXG.Math.Poly.Ring
- JXG.Math.ProbFuncs
- JXG.Math.Quadtree
- JXG.Math.Statistics
- JXG.NoRenderer
- JXG.Options
- JXG.Plane3D
- JXG.Point
- JXG.Point3D
- JXG.Polygon
- JXG.Polygon3D
- JXG.PrefixParser
- JXG.Sphere3D
- JXG.Surface3D
- JXG.SVGRenderer
- JXG.Text
- JXG.Text3D
- JXG.Ticks
- JXG.Transformation
- JXG.Turtle
- JXG.Util
- JXG.Util.Base64
- JXG.Util.Unzip
- JXG.Util.UTF8
- JXG.View3D
- JXG.VMLRenderer
- JXG.XML

# Class JXG.Transformation

↳ JXG.Transformation

Creates a new transformation object. Do not use this constructor to create a transformation. Use JXG.Board#create with type Transformation instead.
Defined in: transformation.js.

Class Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Transformation(board, type, params, is3D) A transformation consists of a 3x3 matrix, i.e.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> | apply(p, 'self') Transform a point element, that are: Point, Text, Image, Point3D.
| applyOnce(p) Applies a transformation once to a point element, that are: Point, Text, Image, Point3D or to an array of such elements.
| bindTo(el) Binds a transformation to a GeometryElement or an array of elements.
| clone() Create a copy of the transformation in case it is static, i.e.
| melt(t) Combine two transformations to one transformation.
| meltTo(el) Binds a transformation to a GeometryElement or an array of elements.
| setAttribute(term) Empty method.
| setMatrix(board, type, params) Set the transformation matrix for different types of standard transforms.
| setMatrix3D(board, type, params) Set the 3D transformation matrix for different types of standard transforms.
<deprecated> | setProperty(term) Unused
| update() Updates the numerical data for the transformation, i.e.

Class Detail
JXG.Transformation(board, type, params, is3D)
A transformation consists of a 3x3 matrix, i.e. it is a projective transformation.

Parameters:
{JXG.Board} board
  The board the transformation is part of.
{String} type
  Can be
  - 'translate'
  - 'scale'
  - 'reflect'
  - 'rotate'
  - 'shear'
  - 'generic'
  - 'matrix'
{Object} params
  The parameters depend on the transformation type

  Translation matrix:

      ( 1  0  0)   ( z )
      ( a  1  0) * ( x )
      ( b  0  1)   ( y )

  Scale matrix:

      ( 1  0  0)   ( z )
      ( 0  a  0) * ( x )
      ( 0  0  b)   ( y )

  A rotation matrix with angle a (in Radians)

      ( 1    0        0      )   ( z )
      ( 0    cos(a)   -sin(a)) * ( x )
      ( 0    sin(a)   cos(a) )   ( y )

  Shear matrix:

      ( 1  0  0)   ( z )
      ( 0  1  a) * ( x )
      ( 0  b  1)   ( y )

  Generic transformation:

      ( a  b  c )   ( z )
      ( d  e  f ) * ( x )
      ( g  h  i )   ( y )

is3D

Method Detail
<private> {Array} apply(p, 'self')
Transform a point element, that are: Point, Text, Image, Point3D. First, the transformation matrix is updated, then do the matrix-vector-multiplication.

Restricted to 2D transformations.

Parameters:
{JXG.GeometryElement} p
  element which is transformed
{String} 'self'
  Apply the transformation to the initialCoords instead of the coords if this is set.

Returns:
  {Array}

applyOnce(p)
Applies a transformation once to a point element, that are: Point, Text, Image, Point3D or to an array of such elements. If it is a free 2D point, then it can be dragged around later and will overwrite the transformed coordinates.

Parameters:
{JXG.Point|Array} p

bindTo(el)
Binds a transformation to a GeometryElement or an array of elements. In every update of the GeometryElement(s), the transformation is executed. That means, in order to immediately apply the transformation after calling bindTo, a call of board.update() has to follow.

The transformation is simply appended to the existing list of transformations of the object. It is not fused (melt) with an existing transformation.

Parameters:
{Array|JXG.Object} el
  JXG.Object or array of JXG.Object to which the transformation is bound to.

See:
  JXG.Transformation.meltTo

{JXG.Transformation} clone()
Create a copy of the transformation in case it is static, i.e. if the transformation matrix does not depend on other elements.

If the transformation matrix is not static, null will be returned.

Returns:
  {JXG.Transformation}

{JXG.Transform} melt(t)
Combine two transformations to one transformation. This only works if both of transformation matrices consist of numbers solely, and do not contain functions. Multiplies the transformation with a transformation t from the left. i.e. (this) = (t) join (this)

Parameters:
{JXG.Transform} t
  Transformation which is the left multiplicand

Returns:
  {JXG.Transform} the transformation object.

meltTo(el)
Binds a transformation to a GeometryElement or an array of elements. In every update of the GeometryElement(s), the transformation is executed. That means, in order to immediately apply the transformation after calling meltTo, a call of board.update() has to follow.

In case the last transformation of the element and this transformation are static, i.e. the transformation matrices do not depend on other elements, the transformation will be fused into (multiplied with) the last transformation of the element. Thus, the list of transformations is kept small. If the transformation will be the first transformation ot the element, it will be cloned to prevent side effects.

Parameters:
{Array|JXG.Object} el
  JXG.Object or array of JXG.Objects to which the transformation is bound to.

See:
  JXG.Transformation#bindTo

setAttribute(term)
Empty method. Unused.

Parameters:
{Object} term
  Key-value pairs of the attributes.

setMatrix(board, type, params)
Set the transformation matrix for different types of standard transforms.

Parameters:
{JXG.Board} board
{String} type
  Transformation type, possible values are 'translate', 'scale', 'reflect', 'rotate', 'shear', 'generic'.
{Array} params
  Parameters for the various transformation types.

  A transformation with a generic matrix looks like:

      ( a  b  c )   ( z )
      ( d  e  f ) * ( x )
      ( g  h  i )   ( y )

  The transformation matrix then looks like:

  Translation matrix:

      ( 1  0  0)   ( z )
      ( a  1  0) * ( x )
      ( b  0  1)   ( y )

  Scale matrix:

      ( 1  0  0)   ( z )
      ( 0  a  0) * ( x )
      ( 0  0  b)   ( y )

  A rotation matrix with angle a (in Radians)

      ( 1    0        0      )   ( z )
      ( 0    cos(a)   -sin(a)) * ( x )
      ( 0    sin(a)   cos(a) )   ( y )

  Shear matrix:

      ( 1  0  0)   ( z )
      ( 0  1  a) * ( x )
      ( 0  b  1)   ( y )

  Generic transformation (9 parameters):

      ( a  b  c )   ( z )
      ( d  e  f ) * ( x )
      ( g  h  i )   ( y )

  Matrix:

      (         )   ( z )
      (    M    ) * ( x )
      (         )   ( y )

setMatrix3D(board, type, params)
Set the 3D transformation matrix for different types of standard transforms.

Parameters:
{JXG.Board} board
{String} type
  Transformation type, possible values are 'translate', 'scale', 'rotate', 'rotateX', 'rotateY', 'rotateZ', 'shear', 'generic'.
{Array} params
  Parameters for the various transformation types.

  A transformation with a generic matrix looks like:

      ( a  b  c  d)   ( w )
      ( e  f  g  h) * ( x )
      ( i  j  k  l)   ( y )
      ( m  n  o  p)   ( z )

  The transformation matrix then looks like:

  Translation matrix:

      ( 1  0  0  0)   ( w )
      ( a  1  0  0) * ( x )
      ( b  0  1  0)   ( y )
      ( c  0  0  1)   ( z )

  Scale matrix:

      ( 1  0  0  0)   ( w )
      ( 0  a  0  0) * ( x )
      ( 0  0  b  0)   ( y )
      ( 0  0  0  c)   ( z )

  rotateX: a rotation matrix with angle a (in Radians)

      ( 1    0        0             )   ( z )
      ( 0    1        0         0   ) * ( x )
      ( 0    0      cos(a)   -sin(a)) * ( x )
      ( 0    0      sin(a)   cos(a) )   ( y )

  rotateY: a rotation matrix with angle a (in Radians)

      ( 1      0       0           )   ( z )
      ( 0    cos(a)    0    -sin(a)) * ( x )
      ( 0      0       1       0   ) * ( x )
      ( 0    sin(a)    0    cos(a) )   ( y )

  rotateZ: a rotation matrix with angle a (in Radians)

      ( 1      0                0  )   ( z )
      ( 0    cos(a)   -sin(a)   0  ) * ( x )
      ( 0    sin(a)   cos(a)    0  )   ( y )
      ( 0      0         0      1  ) * ( x )

  rotate: a rotation matrix with angle a (in Radians) and normal n.

setProperty(term)
Unused

Parameters:
term

Deprecated:
Use setAttribute

{JXG.Transform} update()
Updates the numerical data for the transformation, i.e. the entry of the subobject matrix.

Returns:
  {JXG.Transform} returns pointer to itself

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Apr 04 2025 09:22:41 GMT+0200 (Mitteleuropäische Sommerzeit)