# 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

# Namespace JXG.Math.Geometry

↳ JXG.Math.Geometry

Defined in: geometry.js.

Namespace Summary
Constructor Attributes | Constructor Name and Description
--- | ---
| JXG.Math.Geometry Math.Geometry namespace definition.

Method Summary
Method Attributes | Method Name and Description
--- | ---
<private> <static> | JXG.Math.Geometry._bezierBbox(curve) Computes the bounding box [minX, maxY, maxX, minY] of a Bezier curve segment from its control points.
<private> <static> | JXG.Math.Geometry._bezierLineMeetSubdivision(testSegment, blue, level, testSegment)
<private> <static> | JXG.Math.Geometry._bezierListConcat(L, Lnew, t1, t2) Append list of intersection points to a list.
<private> <static> | JXG.Math.Geometry._bezierMeetSubdivision(red, blue, level) Find intersections of two Bezier curve segments by recursive subdivision.
<private> <static> | JXG.Math.Geometry._bezierOverlap(bb1, bb2) Decide if two Bezier curve segments overlap by comparing their bounding boxes.
<private> <static> | JXG.Math.Geometry._bezierSplit(curve) Splits a Bezier curve segment defined by four points into two Bezier curve segments.
<private> <static> | JXG.Math.Geometry._paramsOutOfRange(params, r_u, r_v) Test if parameters are inside of allowed ranges
<static> | JXG.Math.Geometry.affineDistance(array1, array2, n) Calculates Euclidean distance for two given arrays of the same length.
<static> | JXG.Math.Geometry.affineRatio(a, b, c) Affine ratio of three collinear points a, b, c: (c - a) / (b - a).
<static> <deprecated> | JXG.Math.Geometry.angle(A, B, C) Calculates the angle defined by the points A, B, C.
<static> | JXG.Math.Geometry.angleBisector(A, B, C, board) Calculates a point on the bisection line between the three points A, B, C.
<static> | JXG.Math.Geometry.bezierArc(A, B, C, withLegs, sgn) Generate the defining points of a 3rd degree bezier curve that approximates a circle sector defined by three coordinate points A, B, C, each defined by an array of length three.
<static> | JXG.Math.Geometry.calcLabelQuadrant(angle) Calculates the visProp.position corresponding to a given angle.
<static> | JXG.Math.Geometry.calcLineDelimitingPoints(el, point1, point2) A line can be a segment, a straight, or a ray.
<static> | JXG.Math.Geometry.calcStraight(el, point1, point2, margin) A line can be a segment, a straight, or a ray.
<static> | JXG.Math.Geometry.circumcenter(point1, point2, point3, board) Calculates the center of the circumcircle of the three given points.
<static> <deprecated> | JXG.Math.Geometry.circumcenterMidpoint()
<static> | JXG.Math.Geometry.convexHull(points, returnCoords) Calculate the complex hull of a point cloud by the Graham scan algorithm.
<private> <static> | JXG.Math.Geometry.coordsOnArc(arc, coords) Returns true if the coordinates are on the arc element, false otherwise.
<static> | JXG.Math.Geometry.det3p(p1, p2, q) Determinant of three points in the Euclidean plane.
<static> | JXG.Math.Geometry.distance(array1, array2, n) Calculates the Euclidean distance for two given arrays of the same length.
<static> | JXG.Math.Geometry.distPointLine(point, line) Calculates the distance of a point to a line.
<static> | JXG.Math.Geometry.distPointSegment(q, p1, p2) Determine the (Euclidean) distance between a point q and a line segment defined by two points p1 and p2.
<static> | JXG.Math.Geometry.GrahamScan(points) Calculate the complex hull of a point cloud by the Graham scan algorithm.
<static> | JXG.Math.Geometry.intersectionFunction(board, el1,el2,i, i, j, alwaysintersect) Generate the function which computes the coordinates of the intersection point.

<static>

JXG.Math.Geometry.intersectionFunction3D(el1, el2, el2)
Generate the function which computes the data of the intersection between

- plane3d, plane3d,
- plane3d, sphere3d,
- sphere3d, plane3d,
- sphere3d, sphere3d

<static> | JXG.Math.Geometry.isConvex(points) Determine if a polygon or a path element is convex: A polygon is convex if for every pair of points, the line segment connecting them does not intersect an edge of the polygon in one point.
<static> | JXG.Math.Geometry.isSameDir(p1, p2, i1, i2) The vectors `p2-p1` and `i2-i1` are supposed to be collinear.
<static> | JXG.Math.Geometry.isSameDirection(start, p, s) If you're looking from point "start" towards point "s" and you can see the point "p", return true.
<static> | JXG.Math.Geometry.meet(el1, el2, i, board) Computes the intersection of a pair of lines, circles or both.
<static> | JXG.Math.Geometry.meet3Planes(n1, d1, n2, d2, n3, d3) Intersecting point of three planes in 3D.
<static> | JXG.Math.Geometry.meetBezierCurveRedBlueSegments(red, blue, nr) Find the nr-th intersection point of two Bezier curves, i.e.
<static> | JXG.Math.Geometry.meetBeziersegmentBeziersegment(red, blue, testSegment) Find the nr-th intersection point of two Bezier curve segments.
<static> | JXG.Math.Geometry.meetCircleCircle(circ1, circ2, i, board) Intersection of two circles.
<static> | JXG.Math.Geometry.meetCurveCurve(c1, c2, nr, t2ini, board, method) Compute an intersection of the curves c1 and c2.
<static> | JXG.Math.Geometry.meetCurveLine(el1, el2, nr, board, alwaysIntersect) Intersection of curve with line, Order of input does not matter for el1 and el2.
<static> | JXG.Math.Geometry.meetCurveLineContinuous(cu, li, nr, board, testSegment) Intersection of line and curve, continuous case.
<static> | JXG.Math.Geometry.meetCurveLineDiscrete(cu, li, nr, board, testSegment) Intersection of line and curve, discrete case.
<static> | JXG.Math.Geometry.meetCurveRedBlueSegments(red, blue, nr) Find the n-th intersection point of two curves named red (first parameter) and blue (second parameter).
<static> | JXG.Math.Geometry.meetLineBoard(line, board, margin) Intersection of the line with the board
<static> | JXG.Math.Geometry.meetLineCircle(lin, circ, i, board) Intersection of line and circle.
<static> | JXG.Math.Geometry.meetLineLine(l1, l2, i, board) Intersection of two lines.
<static> | JXG.Math.Geometry.meetPathPath(path1, path2, n, board) Find the n-th intersection point of two pathes, usually given by polygons.
<static> | JXG.Math.Geometry.meetPlanePlane(v11, v12, v21, v22) Direction of intersecting line of two planes in 3D.
<static> | JXG.Math.Geometry.meetPolygonLine(path, line, nr, board, alwaysIntersect) Find the n-th intersection point between a polygon and a line.
<static> | JXG.Math.Geometry.meetSegmentSegment(p1, p2, q1, q2) (Virtual) Intersection of two segments.
<static> | JXG.Math.Geometry.perpendicular(line, point, board) Calculates the coordinates of a point on the perpendicular to the given line through the given point.
<static> | JXG.Math.Geometry.pnpoly(x_in, y_in, path, coord_type, board) Decides if a point (x,y) is inside of a path / polygon.
<static> | JXG.Math.Geometry.projectCoordsToBeziersegment(pos, curve, start) Finds the coordinates of the closest point on a Bezier segment of a JXG.Curve to a given coordinate array.
<static> | JXG.Math.Geometry.projectCoordsToCurve(x, y, t, curve, board) Calculates the coordinates of the projection of a coordinates pair on a given curve.
<static> | JXG.Math.Geometry.projectCoordsToParametric(p, target, params, params) Given the 2D screen coordinates of a point, finds the nearest point on the given parametric curve or surface, and returns its view-space coordinates.
<static> | JXG.Math.Geometry.projectCoordsToPolygon(p, pol) Calculates the coordinates of the closest orthogonal projection of a given coordinate array onto the border of a polygon.
<static> | JXG.Math.Geometry.projectCoordsToSegment(p, q1, q2) Calculates the coordinates of the orthogonal projection of a given coordinate array on a given line segment defined by two coordinate arrays.
<static> | JXG.Math.Geometry.projectPointToBoard(point, board)
<static> | JXG.Math.Geometry.projectPointToCircle(point, circle, board) Calculates the coordinates of the projection of a given point on a given circle.
<static> | JXG.Math.Geometry.projectPointToCurve(point, curve, board) Calculates the coordinates of the projection of a given point on a given curve.
<static> | JXG.Math.Geometry.projectPointToLine(point, line, board) Calculates the coordinates of the orthogonal projection of a given point on a given line.
<static> | JXG.Math.Geometry.projectPointToPoint(point, dest) Trivial projection of a point to another point.
<static> | JXG.Math.Geometry.projectPointToTurtle(point, turtle, board) Calculates the coordinates of the projection of a given point on a given turtle.
<static> | JXG.Math.Geometry.rad(A, B, C) Calculates the internal angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
<static> | JXG.Math.Geometry.reflection(line, point, board) Reflects the point along the line.
<static> | JXG.Math.Geometry.reuleauxPolygon(points, nr) Helper function to create curve which displays a Reuleaux polygons.
<static> | JXG.Math.Geometry.rotation(rotpoint, point, phi, board) Computes the new position of a point which is rotated around a second point (called rotpoint) by the angle phi.
<static> | JXG.Math.Geometry.signedPolygon(p, sort) Determine the signed area of a non-self-intersecting polygon.
<static> | JXG.Math.Geometry.signedTriangle(p1, p2, p3) Signed triangle area of the three points given.
<static> | JXG.Math.Geometry.sortVertices(p) Sort vertices counter clockwise starting with the first point.
<static> | JXG.Math.Geometry.trueAngle(A, B, C) Calculates the angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.
<static> | JXG.Math.Geometry.windingNumber(usrCoords, path, doNotClosePath) Winding number of a point in respect to a polygon path.

Namespace Detail
JXG.Math.Geometry
Math.Geometry namespace definition. This namespace holds geometrical algorithms, especially intersection algorithms.
Method Detail
<private> <static> {Array} JXG.Math.Geometry._bezierBbox(curve)
Computes the bounding box [minX, maxY, maxX, minY] of a Bezier curve segment from its control points.

Parameters:
{Array} curve
  Array of four coordinate arrays of length 2 defining a Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].

Returns:
  {Array} Bounding box [minX, maxY, maxX, minY]

<private> <static> JXG.Math.Geometry._bezierLineMeetSubdivision(testSegment, blue, level, testSegment)

Parameters:
{Boolean} testSegment
  Test if intersection has to be inside of the segment or somewhere on the line defined by the segment
blue
level
testSegment

<private> <static> JXG.Math.Geometry._bezierListConcat(L, Lnew, t1, t2)
Append list of intersection points to a list.

Parameters:
L
Lnew
t1
t2

<private> <static> {Array} JXG.Math.Geometry._bezierMeetSubdivision(red, blue, level)
Find intersections of two Bezier curve segments by recursive subdivision. Below maxlevel determine intersections by intersection line segments.

Parameters:
{Array} red
  Array of four coordinate arrays of length 2 defining the first Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].
{Array} blue
  Array of four coordinate arrays of length 2 defining the second Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].
{Number} level
  Recursion level

Returns:
  {Array} List of intersection points (up to nine). Each intersection point is an array of length three (homogeneous coordinates) plus preimages.

<private> <static> {Boolean} JXG.Math.Geometry._bezierOverlap(bb1, bb2)
Decide if two Bezier curve segments overlap by comparing their bounding boxes.

Parameters:
{Array} bb1
  Bounding box of the first Bezier curve segment
{Array} bb2
  Bounding box of the second Bezier curve segment

Returns:
  {Boolean} true if the bounding boxes overlap, false otherwise.

<private> <static> {Array} JXG.Math.Geometry._bezierSplit(curve)
Splits a Bezier curve segment defined by four points into two Bezier curve segments. Dissection point is t=1/2.

Parameters:
{Array} curve
  Array of four coordinate arrays of length 2 defining a Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].

Returns:
  {Array} Array consisting of two coordinate arrays for Bezier curves.

<private> <static> JXG.Math.Geometry._paramsOutOfRange(params, r_u, r_v)
Test if parameters are inside of allowed ranges

Parameters:
{Array} params
  Array of length 1 or 2
{Array} r_u
  First range
{Array} r_v Optional
  Second range

Returns:
  Boolean

<static> {Number} JXG.Math.Geometry.affineDistance(array1, array2, n)
Calculates Euclidean distance for two given arrays of the same length. If one of the arrays contains a zero in the first coordinate, and the Euclidean distance is different from zero it is a point at infinity and we return Infinity.

Parameters:
{Array} array1
  Array containing elements of type number.
{Array} array2
  Array containing elements of type number.
{Number} n Optional
  Length of the arrays. Default is the minimum length of the given arrays.

Returns:
  {Number} Euclidean (affine) distance of the given vectors.

<static> {Number} JXG.Math.Geometry.affineRatio(a, b, c)
Affine ratio of three collinear points a, b, c: (c - a) / (b - a). If r > 1 or r < 0 then c is outside of the segment ab.

Parameters:
{Array|JXG.Coords} a
{Array|JXG.Coords} b
{Array|JXG.Coords} c

Returns:
  {Number} affine ratio (c - a) / (b - a)

<static> {Number} JXG.Math.Geometry.angle(A, B, C)
Calculates the angle defined by the points A, B, C.

Parameters:
{JXG.Point|Array} A
  A point or [x,y] array.
{JXG.Point|Array} B
  Another point or [x,y] array.
{JXG.Point|Array} C
  A circle - no, of course the third point or [x,y] array.

Deprecated:
Use JXG.Math.Geometry.rad instead.

Returns:
  {Number} The angle in radian measure.

See:
  JXG.Math.Geometry.rad
  JXG.Math.Geometry.trueAngle

<static> {JXG.Coords} JXG.Math.Geometry.angleBisector(A, B, C, board)
Calculates a point on the bisection line between the three points A, B, C. As a result, the bisection line is defined by two points: Parameter B and the point with the coordinates calculated in this function. Does not work for ideal points.

Parameters:
{JXG.Point} A
  Point
{JXG.Point} B
  Point
{JXG.Point} C
  Point
board Optional, Default: A.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the second point defining the bisection.

<static> JXG.Math.Geometry.bezierArc(A, B, C, withLegs, sgn)
Generate the defining points of a 3rd degree bezier curve that approximates a circle sector defined by three coordinate points A, B, C, each defined by an array of length three. The coordinate arrays are given in homogeneous coordinates.

Parameters:
{Array} A
  First point
{Array} B
  Second point (intersection point)
{Array} C
  Third point
{Boolean} withLegs
  Flag. If true the legs to the intersection point are part of the curve.
{Number} sgn
  Wither 1 or -1. Needed for minor and major arcs. In case of doubt, use 1.

<static> JXG.Math.Geometry.calcLabelQuadrant(angle)
Calculates the visProp.position corresponding to a given angle.

Parameters:
{number} angle
  angle in radians. Must be in range (-2pi,2pi).

<static> JXG.Math.Geometry.calcLineDelimitingPoints(el, point1, point2)
A line can be a segment, a straight, or a ray. so it is not always delimited by point1 and point2. This method adjusts the line's delimiting points taking into account its nature, the viewport defined by the board. A segment is delimited by start and end point, a straight line or ray is delimited until it meets the boards boundaries. However, if the line has infinite ticks, it will be delimited by the projection of the boards vertices onto itself.

Parameters:
{JXG.Line} el
  Reference to a line object, that needs calculation of start and end point.
{JXG.Coords} point1
  Coordinates of the point where line drawing begins. This value is calculated and set by this method.
{JXG.Coords} point2
  Coordinates of the point where line drawing ends. This value is calculated and set by this method.

See:
  Line
  JXG.Line

<static> JXG.Math.Geometry.calcStraight(el, point1, point2, margin)
A line can be a segment, a straight, or a ray. So it is not always delimited by point1 and point2 calcStraight determines the visual start point and end point of the line. A segment is only drawn from start to end point, a straight line is drawn until it meets the boards boundaries.

Parameters:
{JXG.Line} el
  Reference to a line object, that needs calculation of start and end point.
{JXG.Coords} point1
  Coordinates of the point where line drawing begins. This value is calculated and set by this method.
{JXG.Coords} point2
  Coordinates of the point where line drawing ends. This value is calculated and set by this method.
{Number} margin
  Optional margin, to avoid the display of the small sides of lines.

Returns:
  null

See:
  Line
  JXG.Line

<static> {JXG.Coords} JXG.Math.Geometry.circumcenter(point1, point2, point3, board)
Calculates the center of the circumcircle of the three given points.

Parameters:
{JXG.Point} point1
  Point
{JXG.Point} point2
  Point
{JXG.Point} point3
  Point
{JXG.Board} board Optional, Default: point1.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the center of the circumcircle of the given points.

<static> JXG.Math.Geometry.circumcenterMidpoint()

Deprecated:
Please use JXG.Math.Geometry.circumcenter instead.

<static> {Array} JXG.Math.Geometry.convexHull(points, returnCoords)
Calculate the complex hull of a point cloud by the Graham scan algorithm.

Parameters:
{Array} points
  An array containing JXG.Point, JXG.Coords, and/or arrays.
{Boolean} returnCoords Optional, Default: false
  If true, return an array of coords. Otherwise return a list of pointers to the input list elements. That is, if the input is a list of JXG.Point elements, the returned list will contain the points that form the convex hull.

Returns:
  {Array} List containing the convex hull. Format depends on returnCoords.

See:
  JXG.Math.Geometry.GrahamScan

Examples:

        // Static example
        var i, hull,
            p = [];

        p.push( board.create('point', [4, 0], {withLabel:false }) );
        p.push( board.create('point', [0, 4], {withLabel:false }) );
        p.push( board.create('point', [0, 0], {withLabel:false }) );
        p.push( board.create('point', [1, 1], {withLabel:false }) );
        hull = JXG.Math.Geometry.convexHull(p);
        for (i = 0; i < hull.length; i++) {
          hull[i].setAttribute({color: 'blue'});
        }

        // Dynamic version using returnCoords==true: drag the points
        var p = [];

        p.push( board.create('point', [4, 0], {withLabel:false }) );
        p.push( board.create('point', [0, 4], {withLabel:false }) );
        p.push( board.create('point', [0, 0], {withLabel:false }) );
        p.push( board.create('point', [1, 1], {withLabel:false }) );

        var c = board.create('curve', [[], []], {fillColor: 'yellow', fillOpacity: 0.3});
        c.updateDataArray = function() {
          var i,
            hull = JXG.Math.Geometry.convexHull(p, true);

          this.dataX = [];
          this.dataY = [];

          for (i = 0; i < hull.length; i ++) {
            this.dataX.push(hull[i][1]);
            this.dataY.push(hull[i][2]);
          }
          this.dataX.push(hull[0][1]);
          this.dataY.push(hull[0][2]);
        };
        board.update();

<private> <static> {Boolean} JXG.Math.Geometry.coordsOnArc(arc, coords)
Returns true if the coordinates are on the arc element, false otherwise. Usually, coords is an intersection on the circle line. Now it is decided if coords are on the circle restricted to the arc line.

Parameters:
{Arc} arc
  arc or sector element
{JXG.Coords} coords
  Coords object of an intersection

Returns:
  {Boolean}

<static> {Number} JXG.Math.Geometry.det3p(p1, p2, q)
Determinant of three points in the Euclidean plane. Zero, if the points are collinear. Used to determine of a point q is left or right to a segment defined by points p1 and p2.

Non-homogeneous version.

Parameters:
{Array|JXG.Point} p1
  First point or its coordinates of the segment. Point object or array of length 3. First (homogeneous) coordinate is equal to 1.
{Array|JXG.Point} p2
  Second point or its coordinates of the segment. Point object or array of length 3. First (homogeneous) coordinate is equal to 1.
{Array|JXG.Point} q
  Point or its coordinates. Point object or array of length 3. First (homogeneous) coordinate is equal to 1.

Returns:
  {Number} Signed area of the triangle formed by these three points.

See:
  JXG.Math.Geometry.windingNumber

<static> {Number} JXG.Math.Geometry.distance(array1, array2, n)
Calculates the Euclidean distance for two given arrays of the same length.

Parameters:
{Array} array1
  Array of Number
{Array} array2
  Array of Number
{Number} n Optional
  Length of the arrays. Default is the minimum length of the given arrays.

Returns:
  {Number} Euclidean distance of the given vectors.

<static> {Number} JXG.Math.Geometry.distPointLine(point, line)
Calculates the distance of a point to a line. The point and the line are given by homogeneous coordinates. For lines this can be line.stdform.

Parameters:
{Array} point
  Homogeneous coordinates of a point.
{Array} line
  Homogeneous coordinates of a line ([C,A,B] where A*x+B*y+C*z=0).

Returns:
  {Number} Distance of the point to the line.

<static> {Number} JXG.Math.Geometry.distPointSegment(q, p1, p2)
Determine the (Euclidean) distance between a point q and a line segment defined by two points p1 and p2. In case p1 equals p2, the distance to this point is returned.

Parameters:
{Array} q
  Homogeneous coordinates of q
{Array} p1
  Homogeneous coordinates of p1
{Array} p2
  Homogeneous coordinates of p2

Returns:
  {Number} Distance of q to line segment [p1, p2]

<static> {Array} JXG.Math.Geometry.GrahamScan(points)
Calculate the complex hull of a point cloud by the Graham scan algorithm.

Parameters:
{Array} points
  An array containing JXG.Point, JXG.Coords, and/or arrays.

Returns:
  {Array} List of objects

      {i: index, c: coords}

  containing the convex hull points in form of the index in the original input array and a coords array.

Examples:

        // Static example

        var i, hull,
          p = [],
          q = [];

        p.push( board.create('point', [4, 0], {withLabel:false }) );
        p.push( board.create('point', [0, 4], {withLabel:false }) );
        p.push( board.create('point', [0, 0], {withLabel:false }) );
        p.push([-1, 0]);
        p.push([-3, -3]);

        hull = JXG.Math.Geometry.GrahamScan(p);
        for (i = 0; i < hull.length; i++) {
          console.log(hull[i]);
          q.push(hull[i].c);
        }
        board.create('polygon', q);
        // Output:
        // { i: 4, c: [1, -3, 3]}
        // { i: 0, c: [1, 4, 0]}
        // { i: 1, c: [1, 0, 4]}

<static> {Function} JXG.Math.Geometry.intersectionFunction(board, el1,el2,i, i, j, alwaysintersect)
Generate the function which computes the coordinates of the intersection point. Primarily used in JXG.Point.createIntersectionPoint.

Parameters:
{JXG.Board} board
  object
{JXG.Line|JXG.Circle_JXG.Line|JXG.Circle_Number|Function} el1,el2,i
  The result will be a intersection point on el1 and el2. i determines the intersection point if two points are available:
  - i==0: use the positive square root,
  - i==1: use the negative square root.
{Boolean} alwaysintersect.
  Flag that determines if segments and arc can have an outer intersection point on their defining line or circle.
i
j
alwaysintersect

Returns:
  {Function} Function returning a JXG.Coords object that determines the intersection point.

See:
  JXG.Point.createIntersectionPoint

<static> {Array} JXG.Math.Geometry.intersectionFunction3D(el1, el2, el2)
Generate the function which computes the data of the intersection between

- plane3d, plane3d,
- plane3d, sphere3d,
- sphere3d, plane3d,
- sphere3d, sphere3d

Parameters:
{JXG.GeometryElement3D} el1
  Plane or sphere element
{JXG.GeometryElement3D} el2
  Plane or sphere element
el2

Returns:
  {Array} of functions needed as input to create the intersecting line or circle.

<static> {Boolean} JXG.Math.Geometry.isConvex(points)
Determine if a polygon or a path element is convex:

A polygon is convex if for every pair of points, the line segment connecting them does not intersect an edge of the polygon in one point. A single line segment, a single point, or the empty set is considered as convex. A necessary condition for a polygon to be convex that the angle sum of its interior angles equals ± 2 π.

A path element might be specified as an array of coordinate arrays or JXG.Coords. See the discussion at stackoverflow.

Parameters:
{Array|Polygon|PolygonalChain} points
  Polygon or list of coordinates

Returns:
  {Boolean} true if convex

Examples:

    var pol = board.create('polygon', [
        [-1, -1],
        [3, -1],
        [4, 2],
        [3, 3],
        [0, 4],
        [-3, 1]
    ], {
        vertices: {
            color: 'blue',
            snapToGrid: true
        }
    });

    console.log(JXG.Math.Geometry.isConvex(pol));
    // > true

<static> {Boolean} JXG.Math.Geometry.isSameDir(p1, p2, i1, i2)
The vectors `p2-p1` and `i2-i1` are supposed to be collinear. If their cosine is positive they point into the same direction otherwise they point in opposite direction.

Parameters:
{JXG.Coords} p1
{JXG.Coords} p2
{JXG.Coords} i1
{JXG.Coords} i2

Returns:
  {Boolean} True, if `p2-p1` and `i2-i1` point into the same direction

<static> {Boolean} JXG.Math.Geometry.isSameDirection(start, p, s)
If you're looking from point "start" towards point "s" and you can see the point "p", return true. Otherwise return false.

Parameters:
{JXG.Coords} start
  The point you're standing on.
{JXG.Coords} p
  The point in which direction you're looking.
{JXG.Coords} s
  The point that should be visible.

Returns:
  {Boolean} True, if from start the point p is in the same direction as s is, that means s-start = k*(p-start) with k>=0.

<static> {JXG.Coords} JXG.Math.Geometry.meet(el1, el2, i, board)
Computes the intersection of a pair of lines, circles or both. It uses the internal data array stdform of these elements.

Parameters:
{Array} el1
  stdform of the first element (line or circle)
{Array} el2
  stdform of the second element (line or circle)
{Number|Function} i
  Index of the intersection point that should be returned.
board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of one of the possible two or more intersection points. Which point will be returned is determined by i.

<static> {Array} JXG.Math.Geometry.meet3Planes(n1, d1, n2, d2, n3, d3)
Intersecting point of three planes in 3D. The planes are given in Hesse normal form.

Parameters:
{Array} n1
  Hesse normal form vector of plane 1
{Number} d1
  Hesse normal form right hand side of plane 1
{Array} n2
  Hesse normal form vector of plane 2
{Number} d2
  Hesse normal form right hand side of plane 2
{Array} n3
  Hesse normal form vector of plane 1
{Number} d3
  Hesse normal form right hand side of plane 3

Returns:
  {Array} Coordinates array of length 4 of the intersecting point

<static> {Array} JXG.Math.Geometry.meetBezierCurveRedBlueSegments(red, blue, nr)
Find the nr-th intersection point of two Bezier curves, i.e. curves with bezierDegree == 3.

Parameters:
{JXG.Curve} red
  Curve with bezierDegree == 3
{JXG.Curve} blue
  Curve with bezierDegree == 3
{Number|Function} nr
  The number of the intersection point which should be returned.

Returns:
  {Array} The homogeneous coordinates of the nr-th intersection point.

<static> {Array} JXG.Math.Geometry.meetBeziersegmentBeziersegment(red, blue, testSegment)
Find the nr-th intersection point of two Bezier curve segments.

Parameters:
{Array} red
  Array of four coordinate arrays of length 2 defining the first Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].
{Array} blue
  Array of four coordinate arrays of length 2 defining the second Bezier curve segment, i.e. [[x0,y0], [x1,y1], [x2,y2], [x3,y3]].
{Boolean} testSegment
  Test if intersection has to be inside of the segment or somewhere on the line defined by the segment

Returns:
  {Array} Array containing the list of all intersection points as homogeneous coordinate arrays plus preimages [x,y], t_1, t_2] of the two Bezier curve segments.

<static> {JXG.Coords} JXG.Math.Geometry.meetCircleCircle(circ1, circ2, i, board)
Intersection of two circles.

Parameters:
{Array} circ1
  stdform of the first circle
{Array} circ2
  stdform of the second circle
{number|function} i
  number of the returned intersection point. i==0: use the positive square root, i==1: use the negative square root.
{JXG.Board} board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of the intersection point

<static> {JXG.Coords} JXG.Math.Geometry.meetCurveCurve(c1, c2, nr, t2ini, board, method)
Compute an intersection of the curves c1 and c2. We want to find values t1, t2 such that c1(t1) = c2(t2), i.e. (c1_x(t1)-c2_x(t2),c1_y(t1)-c2_y(t2)) = (0,0). Methods: segment-wise intersections (default) or generalized Newton method.

Parameters:
{JXG.Curve} c1
  Curve, Line or Circle
{JXG.Curve} c2
  Curve, Line or Circle
{Number|Function} nr
  the nr-th intersection point will be returned.
{Number} t2ini
  not longer used.
{JXG.Board} board Optional, Default: c1.board
  Reference to a board object.
{String} method Optional, Default: 'segment'
  Intersection method, possible values are 'newton' and 'segment'.

Returns:
  {JXG.Coords} intersection point

<static> {JXG.Coords} JXG.Math.Geometry.meetCurveLine(el1, el2, nr, board, alwaysIntersect)
Intersection of curve with line, Order of input does not matter for el1 and el2. From version 0.99.7 on this method calls JXG.Math.Geometry.meetCurveLineDiscrete. If higher precision is needed, JXG.Math.Geometry.meetCurveLineContinuous has to be used.

Parameters:
{JXG.Curve|JXG.Line} el1
  Curve or Line
{JXG.Curve|JXG.Line} el2
  Curve or Line
{Number|Function} nr
  the nr-th intersection point will be returned.
{JXG.Board} board Optional, Default: el1.board
  Reference to a board object.
{Boolean} alwaysIntersect
  If false just the segment between the two defining points are tested for intersection

Returns:
  {JXG.Coords} Intersection point. In case no intersection point is detected, the ideal point [0,1,0] is returned.

<static> {JXG.Coords} JXG.Math.Geometry.meetCurveLineContinuous(cu, li, nr, board, testSegment)
Intersection of line and curve, continuous case. Finds the nr-the intersection point Uses JXG.Math.Geometry.meetCurveLineDiscrete as a first approximation. A more exact solution is then found with JXG.Math.Numerics.root.

Parameters:
{JXG.Curve} cu
  Curve
{JXG.Line} li
  Line
{NumberFunction} nr
  Will return the nr-th intersection point.
{JXG.Board} board
{Boolean} testSegment
  Test if intersection has to be inside of the segment or somewhere on the line defined by the segment

Returns:
  {JXG.Coords} Coords object containing the intersection.

<static> {JXG.Coords} JXG.Math.Geometry.meetCurveLineDiscrete(cu, li, nr, board, testSegment)
Intersection of line and curve, discrete case. Segments are treated as lines. Finding the nr-th intersection point should work for all nr.

Parameters:
{JXG.Curve} cu
{JXG.Line} li
{Number|Function} nr
{JXG.Board} board
{Boolean} testSegment
  Test if intersection has to be inside of the segment or somewhere on the line defined by the segment

Returns:
  {JXG.Coords} Intersection point. In case no intersection point is detected, the ideal point [0,1,0] is returned.

<static> JXG.Math.Geometry.meetCurveRedBlueSegments(red, blue, nr)
Find the n-th intersection point of two curves named red (first parameter) and blue (second parameter). We go through each segment of the red curve and search if there is an intersection with a segment of the blue curve. This double loop, i.e. the outer loop runs along the red curve and the inner loop runs along the blue curve, defines the n-th intersection point. The segments are either line segments or Bezier curves of degree 3. This depends on the property bezierDegree of the curves.

This method works also for transformed curves, since only the already transformed points are used.

Parameters:
{JXG.Curve} red
{JXG.Curve} blue
{Number|Function} nr

<static> {Array} JXG.Math.Geometry.meetLineBoard(line, board, margin)
Intersection of the line with the board

Parameters:
{Array} line
  stdform of the line in screen coordinates
{JXG.Board} board
  reference to a board.
{Number} margin
  optional margin, to avoid the display of the small sides of lines.

Returns:
  {Array} [intersection coords 1, intersection coords 2]

<static> {JXG.Coords} JXG.Math.Geometry.meetLineCircle(lin, circ, i, board)
Intersection of line and circle.

Parameters:
{Array} lin
  stdform of the line
{Array} circ
  stdform of the circle
{number|function} i
  number of the returned intersection point. i==0: use the positive square root, i==1: use the negative square root.
{JXG.Board} board
  Reference to a board.

Returns:
  {JXG.Coords} Coordinates of the intersection point

<static> {JXG.Coords} JXG.Math.Geometry.meetLineLine(l1, l2, i, board)
Intersection of two lines.

Parameters:
{Array} l1
  stdform of the first line
{Array} l2
  stdform of the second line
{number} i
  unused
{JXG.Board} board
  Reference to the board.

Returns:
  {JXG.Coords} Coordinates of the intersection point.

<static> {JXG.Coords} JXG.Math.Geometry.meetPathPath(path1, path2, n, board)
Find the n-th intersection point of two pathes, usually given by polygons. Uses parts of the Greiner-Hormann algorithm in JXG.Math.Clip.

Parameters:
{JXG.Circle|JXG.Curve|JXG.Polygon} path1
{JXG.Circle|JXG.Curve|JXG.Polygon} path2
{Number|Function} n
{JXG.Board} board

Returns:
  {JXG.Coords} Intersection point. In case no intersection point is detected, the ideal point [0,0,0] is returned.

<static> {Array} JXG.Math.Geometry.meetPlanePlane(v11, v12, v21, v22)
Direction of intersecting line of two planes in 3D.

Parameters:
{Array} v11
  First vector spanning plane 1 (homogeneous coordinates)
{Array} v12
  Second vector spanning plane 1 (homogeneous coordinates)
{Array} v21
  First vector spanning plane 2 (homogeneous coordinates)
{Array} v22
  Second vector spanning plane 2 (homogeneous coordinates)

Returns:
  {Array} Coordinates array of length 4 of the direction (homogeneous coordinates)

<static> {JXG.Coords} JXG.Math.Geometry.meetPolygonLine(path, line, nr, board, alwaysIntersect)
Find the n-th intersection point between a polygon and a line.

Parameters:
{JXG.Polygon} path
{JXG.Line} line
{Number|Function} nr
{JXG.Board} board
{Boolean} alwaysIntersect
  If false just the segment between the two defining points of the line are tested for intersection.

Returns:
  {JXG.Coords} Intersection point. In case no intersection point is detected, the ideal point [0,0,0] is returned.

<static> {Array} JXG.Math.Geometry.meetSegmentSegment(p1, p2, q1, q2)
(Virtual) Intersection of two segments.

Parameters:
{Array} p1
  First point of segment 1 using normalized homogeneous coordinates [1,x,y]
{Array} p2
  Second point or direction of segment 1 using normalized homogeneous coordinates [1,x,y] or point at infinity [0,x,y], respectively
{Array} q1
  First point of segment 2 using normalized homogeneous coordinates [1,x,y]
{Array} q2
  Second point or direction of segment 2 using normalized homogeneous coordinates [1,x,y] or point at infinity [0,x,y], respectively

Returns:
  {Array} [Intersection point, t, u] The first entry contains the homogeneous coordinates of the intersection point. The second and third entry give the position of the intersection with respect to the definiting parameters. For example, the second entry t is defined by: intersection point = p1 + t * deltaP, where deltaP = (p2 - p1) when both parameters are coordinates, and deltaP = p2 if p2 is a point at infinity. If the two segments are collinear, [[0,0,0], Infinity, Infinity] is returned.

<static> {Array} JXG.Math.Geometry.perpendicular(line, point, board)
Calculates the coordinates of a point on the perpendicular to the given line through the given point.

Parameters:
{JXG.Line} line
  A line.
{JXG.Point} point
  Point which is projected to the line.
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {Array} Array of length two containing coordinates of a point on the perpendicular to the given line through the given point and boolean flag "change".

<static> {Boolean} JXG.Math.Geometry.pnpoly(x_in, y_in, path, coord_type, board)
Decides if a point (x,y) is inside of a path / polygon. Does not work correct if the path has hole. In this case, windingNumber is the preferred method. Implements W. Randolf Franklin's pnpoly method. See https://wrf.ecse.rpi.edu/Research/Short_Notes/pnpoly.html.

Parameters:
{Number} x_in
  x-coordinate (screen or user coordinates)
{Number} y_in
  y-coordinate (screen or user coordinates)
{Array} path
  Array of points / coords determining a path, i.e. the vertices of the polygon / path. The array elements do not have to be full points, but have to have a subobject "coords" or should be of type JXG.Coords.
{Number} coord_type Optional, Default: JXG.COORDS_BY_SCREEN
  Type of coordinates used here. Possible values are JXG.COORDS_BY_USER and JXG.COORDS_BY_SCREEN. Default value is JXG.COORDS_BY_SCREEN.
{JXG.Board} board
  Board object

Returns:
  {Boolean} if (x_in, y_in) is inside of the polygon.

See:
  JXG.Polygon#hasPoint
  JXG.Polygon#pnpoly
  JXG.Math.Geometry.windingNumber

Examples:

    var pol = board.create('polygon', [[-1,2], [2,2], [-1,4]]);
    var p = board.create('point', [4, 3]);
    var txt = board.create('text', [-1, 0.5, function() {
      return 'Point A is inside of the polygon = ' +
        JXG.Math.Geometry.pnpoly(p.X(), p.Y(), pol.vertices, JXG.COORDS_BY_USER, board);
    }]);

<static> {Array} JXG.Math.Geometry.projectCoordsToBeziersegment(pos, curve, start)
Finds the coordinates of the closest point on a Bezier segment of a JXG.Curve to a given coordinate array.

Parameters:
{Array} pos
  Point to project in homogeneous coordinates.
{JXG.Curve} curve
  Curve of type "plot" having Bezier degree 3.
{Number} start
  Number of the Bezier segment of the curve.

Returns:
  {Array} The coordinates of the projection of the given point on the given Bezier segment and the preimage of the curve which determines the closest point.

<static> {JXG.Coords} JXG.Math.Geometry.projectCoordsToCurve(x, y, t, curve, board)
Calculates the coordinates of the projection of a coordinates pair on a given curve. In case of function graphs this is the intersection point of the curve and the parallel to y-axis through the given point.

Parameters:
{Number} x
  coordinate to project.
{Number} y
  coordinate to project.
{Number} t
  start value for newtons method
{JXG.Curve} curve
  Curve on that the point is projected.
{JXG.Board} board Optional, Default: curve.board
  Reference to a board.

Returns:
  {JXG.Coords} Array containing the coordinates of the projection of the given point on the given curve and the position on the curve.

See:
  JXG.Math.Geometry.projectPointToCurve

<static> {Array} JXG.Math.Geometry.projectCoordsToParametric(p, target, params, params)
Given the 2D screen coordinates of a point, finds the nearest point on the given parametric curve or surface, and returns its view-space coordinates.

Parameters:
{Array} p
  3D coordinates for which the closest point on the curve point is searched.
{JXG.Curve3D|JXG.Surface3D} target
  Parametric curve or surface to project to.
{Array} params
  New position of point on the target (i.e. it is a return value), modified in place during the search, ending up at the nearest point. Usually, point.position is supplied for params.
params

Returns:
  {Array} Array of length 4 containing the coordinates of the nearest point on the curve or surface.

<static> {Array} JXG.Math.Geometry.projectCoordsToPolygon(p, pol)
Calculates the coordinates of the closest orthogonal projection of a given coordinate array onto the border of a polygon.

Parameters:
{Array} p
  Point to project.
{JXG.Polygon} pol
  Polygon element

Returns:
  {Array} The coordinates of the closest projection of the given point to the border of the polygon.

<static> {Array} JXG.Math.Geometry.projectCoordsToSegment(p, q1, q2)
Calculates the coordinates of the orthogonal projection of a given coordinate array on a given line segment defined by two coordinate arrays.

Parameters:
{Array} p
  Point to project.
{Array} q1
  Start point of the line segment on that the point is projected.
{Array} q2
  End point of the line segment on that the point is projected.

Returns:
  {Array} The coordinates of the projection of the given point on the given segment and the factor that determines the projected point as a convex combination of the two endpoints q1 and q2 of the segment.

<static> JXG.Math.Geometry.projectPointToBoard(point, board)

Parameters:
{JXG.Point|JXG.Coords} point
{JXG.Board} board Optional

<static> {JXG.Coords} JXG.Math.Geometry.projectPointToCircle(point, circle, board)
Calculates the coordinates of the projection of a given point on a given circle. I.o.w. the nearest one of the two intersection points of the line through the given point and the circles center.

Parameters:
{JXG.Point|JXG.Coords} point
  Point to project or coords object to project.
{JXG.Circle} circle
  Circle on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given circle.

<static> {Array} JXG.Math.Geometry.projectPointToCurve(point, curve, board)
Calculates the coordinates of the projection of a given point on a given curve. Uses JXG.Math.Geometry.projectCoordsToCurve.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Curve} curve
  Curve on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to a board.

Returns:
  {Array} [JXG.Coords, position] The coordinates of the projection of the given point on the given graph and the relative position on the curve (real number).

See:
  JXG.Math.Geometry.projectCoordsToCurve

<static> {JXG.Coords} JXG.Math.Geometry.projectPointToLine(point, line, board)
Calculates the coordinates of the orthogonal projection of a given point on a given line. I.o.w. the intersection point of the given line and its perpendicular through the given point.

Parameters:
{JXG.Point|JXG.Coords} point
  Point to project.
{JXG.Line} line
  Line on that the point is projected.
{JXG.Board} board Optional, Default: point.board|board=line.board
  Reference to a board.

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given line.

<static> {JXG.Coords} JXG.Math.Geometry.projectPointToPoint(point, dest)
Trivial projection of a point to another point.

Parameters:
{JXG.Point} point
  Point to project (not used).
{JXG.Point} dest
  Point on that the point is projected.

Returns:
  {JXG.Coords} The coordinates of the projection of the given point on the given circle.

<static> {Array} JXG.Math.Geometry.projectPointToTurtle(point, turtle, board)
Calculates the coordinates of the projection of a given point on a given turtle. A turtle consists of one or more curves of curveType 'plot'. Uses JXG.Math.Geometry.projectPointToCurve.

Parameters:
{JXG.Point} point
  Point to project.
{JXG.Turtle} turtle
  on that the point is projected.
{JXG.Board} board Optional, Default: point.board
  Reference to a board.

Returns:
  {Array} [JXG.Coords, position] Array containing the coordinates of the projection of the given point on the turtle and the position on the turtle.

<static> {Number} JXG.Math.Geometry.rad(A, B, C)
Calculates the internal angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.

Parameters:
{JXG.Point|Array} A
  Point or [x,y] array
{JXG.Point|Array} B
  Point or [x,y] array
{JXG.Point|Array} C
  Point or [x,y] array

Returns:
  {Number} Angle in radians.

See:
  JXG.Math.Geometry.trueAngle

<static> {JXG.Coords} JXG.Math.Geometry.reflection(line, point, board)
Reflects the point along the line.

Parameters:
{JXG.Line} line
  Axis of reflection.
{JXG.Point} point
  Point to reflect.
board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the reflected point.

<static> {Array} JXG.Math.Geometry.reuleauxPolygon(points, nr)
Helper function to create curve which displays a Reuleaux polygons.

Parameters:
{Array} points
  Array of points which should be the vertices of the Reuleaux polygon. Typically, these point list is the array vertices of a regular polygon.
{Number} nr
  Number of vertices

Returns:
  {Array} An array containing the two functions defining the Reuleaux polygon and the two values for the start and the end of the paramtric curve. array may be used as parent array of a JXG.Curve.

Examples:

    var A = brd.create('point',[-2,-2]);
    var B = brd.create('point',[0,1]);
    var pol = brd.create('regularpolygon',[A,B,3], {withLines:false, fillColor:'none', highlightFillColor:'none', fillOpacity:0.0});
    var reuleauxTriangle = brd.create('curve', JXG.Math.Geometry.reuleauxPolygon(pol.vertices, 3),
                             {strokeWidth:6, strokeColor:'#d66d55', fillColor:'#ad5544', highlightFillColor:'#ad5544'});

<static> {JXG.Coords} JXG.Math.Geometry.rotation(rotpoint, point, phi, board)
Computes the new position of a point which is rotated around a second point (called rotpoint) by the angle phi.

Parameters:
{JXG.Point} rotpoint
  Center of the rotation
{JXG.Point} point
  point to be rotated
{Number} phi
  rotation angle in arc length
{JXG.Board} board Optional, Default: point.board
  Reference to the board

Returns:
  {JXG.Coords} Coordinates of the new position.

<static> {Number} JXG.Math.Geometry.signedPolygon(p, sort)
Determine the signed area of a non-self-intersecting polygon. Surveyor's Formula

Parameters:
{Array} p
  An array containing JXG.Point, JXG.Coords, and/or arrays.
{Boolean} sort Optional, Default: true

Returns:
  {Number}

<static> {Number} JXG.Math.Geometry.signedTriangle(p1, p2, p3)
Signed triangle area of the three points given. It can also be used to test the orientation of the triangle.

- If the return value is < 0, then the point p2 is left of the line [p1, p3] (i.e p3 is right from [p1, p2]).
- If the return value is > 0, then the point p2 is right of the line [p1, p3] (i.e p3 is left from [p1, p2]).
- If the return value is = 0, then the points p1, p2, p3 are collinear.

Parameters:
{JXG.Point|JXG.Coords|Array} p1
{JXG.Point|JXG.Coords|Array} p2
{JXG.Point|JXG.Coords|Array} p3

Returns:
  {Number}

<static> {Array} JXG.Math.Geometry.sortVertices(p)
Sort vertices counter clockwise starting with the first point. Used in Polygon.sutherlandHodgman, Geometry.signedPolygon.

Parameters:
{Array} p
  An array containing JXG.Point, JXG.Coords, and/or arrays.

Returns:
  {Array}

<static> {Number} JXG.Math.Geometry.trueAngle(A, B, C)
Calculates the angle defined by the three points A, B, C if you're going from A to C around B counterclockwise.

Parameters:
{JXG.Point|Array} A
  Point or [x,y] array
{JXG.Point|Array} B
  Point or [x,y] array
{JXG.Point|Array} C
  Point or [x,y] array

Returns:
  {Number} The angle in degrees.

See:
  JXG.Math.Geometry.rad

<static> {Number} JXG.Math.Geometry.windingNumber(usrCoords, path, doNotClosePath)
Winding number of a point in respect to a polygon path. The point is regarded outside if the winding number is zero, inside otherwise. The algorithm tries to find degenerate cases, i.e. if the point is on the path. This is regarded as "outside". If the point is a vertex of the path, it is regarded as "inside". Implementation of algorithm 7 from "The point in polygon problem for arbitrary polygons" by Kai Hormann and Alexander Agathos, Computational Geometry, Volume 20, Issue 3, November 2001, Pages 131-144.

Parameters:
{Array} usrCoords
  Homogenous coordinates of the point
{Array} path
  Array of points / coords determining a path, i.e. the vertices of the polygon / path. The array elements do not have to be full points, but have to have a subobject "coords" or should be of type JXG.Coords.
{Boolean} doNotClosePath Optional, Default: false
  If true the last point of the path is not connected to the first point. This is necessary if the path consists of two or more closed subpaths, e.g. if the figure has a hole.

Returns:
  {Number} Winding number of the point. The point is regarded outside if the winding number is zero, inside otherwise.

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