Namespace JXG.Math.Geometry
↳ JXG.Math.Geometry
Defined in: numerics.js.
Constructor Attributes | Constructor Name and Description |
---|---|
The JXG.Math.Numerics namespace holds numerical algorithms, constants, and variables.
|
Field Attributes | Field Name and Description |
---|---|
<static> <deprecated> |
JXG.Math.Geometry.circumcenterMidpoint
|
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.
|
<static> |
JXG.Math.Geometry.affineDistance(array1, array2, n)
Calculates euclidean distance for two given arrays of the same length.
|
<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 the bisection 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 cricle sector defined by three arrays A, B,C, each of length three.
|
<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> |
JXG.Math.Geometry.distance(array1, array2, n)
Calculates the euclidean norm 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.GrahamScan(points)
Calculate the complex hull of a point cloud.
|
<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 can see the point "p", true is returned.
|
<static> |
JXG.Math.Geometry.meet(el1, el2, i, board)
Computes the intersection of a pair of lines, circles or both.
|
<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)
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.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.meetSegmentSegment(p1, p2, q1, q2)
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.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.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-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 point with the lowest y coordinate.
|
<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.
|
Namespace Detail
JXG.Math.Geometry
The JXG.Math.Numerics namespace holds numerical algorithms, constants, and variables.
Field Detail
<static>
JXG.Math.Geometry.circumcenterMidpoint
Defined in: geometry.js.
- Deprecated:
- Please use JXG.Math.Geometry#circumcenter instead.
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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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)
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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 intersction 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
<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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.angle(A, B, C)
Calculates the angle defined by the points A, B, C.
Defined in: geometry.js.
Defined in: geometry.js.
- 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:
- #rad
- #trueAngle
<static>
{JXG.Coords}
JXG.Math.Geometry.angleBisector(A, B, C, board)
Calculates the bisection between the three points A, B, C. The bisection is defined by two points:
Parameter B and a point with the coordinates calculated in this function.
Defined in: geometry.js.
Defined in: geometry.js.
- 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 cricle sector defined by three arrays A, B,C, each of length three.
The coordinate arrays are given in homogeneous coordinates.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
<static>
{JXG.Coords}
JXG.Math.Geometry.circumcenter(point1, point2, point3, board)
Calculates the center of the circumcircle of the three given points.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{Number}
JXG.Math.Geometry.distance(array1, array2, n)
Calculates the euclidean norm for two given arrays of the same length.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{Array}
JXG.Math.Geometry.GrahamScan(points)
Calculate the complex hull of a point cloud.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} points
- An array containing JXG.Point, JXG.Coords, and/or arrays.
- Returns:
- {Array}
<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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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 can see the point "p", true is returned. Otherwise false.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} el1
- stdform of the first element (line or circle)
- {Array} el2
- stdform of the second element (line or circle)
- {Number} 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.meetBezierCurveRedBlueSegments(red, blue, nr)
Find the nr-th intersection point of two Bezier curves, i.e. curves with bezierDegree == 3.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Curve} red
- Curve with bezierDegree == 3
- {JXG.Curve} blue
- Curve with bezierDegree == 3
- {Number} 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} circ1
- stdform of the first circle
- {Array} circ2
- stdform of the second circle
- {number} 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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Curve} c1
- Curve, Line or Circle
- {JXG.Curve} c2
- Curve, Line or Circle
- {Number} 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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Curve|JXG.Line} el1
- Curve or Line
- {JXG.Curve|JXG.Line} el2
- Curve or Line
- {Number} 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.Math.Geometry.meetCurveLineContinuous(cu, li, nr, board)
Intersection of line and curve, continuous case.
Segments are treated as lines. Finding the nr-the intersection point
works for nr=0,1 only.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Curve} cu
- Curve
- {JXG.Line} li
- Line
- {Number} nr
- Will return the nr-th intersection point.
- {JXG.Board} board
- BUG: does not respect cu.minX() and cu.maxX()
<static>
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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Curve} cu
- {JXG.Line} li
- {Number} 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
<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 segemnt 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.
Defined in: geometry.js.
Defined in: geometry.js.
<static>
{JXG.Coords}
JXG.Math.Geometry.meetLineCircle(lin, circ, i, board)
Intersection of line and circle.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} lin
- stdform of the line
- {Array} circ
- stdform of the circle
- {number} 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{Array}
JXG.Math.Geometry.meetSegmentSegment(p1, p2, q1, q2)
Intersection of two segments.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} p1
- First point of segment 1 using homogeneous coordinates [z,x,y]
- {Array} p2
- Second point of segment 1 using homogeneous coordinates [z,x,y]
- {Array} q1
- First point of segment 2 using homogeneous coordinates [z,x,y]
- {Array} q2
- Second point of segment 2 using homogeneous coordinates [z,x,y]
- Returns:
- {Array} [Intersection point, t, u] The first entry contains the homogeneous coordinates of the intersection point. The second and third entry gives the position of the intersection between the two defining points. For example, the second entry t is defined by: intersection point = t*p1 + (1-t)*p2.
<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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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 graph and the position on the curve.
- See:
- #projectPointToCurve
<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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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)
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{JXG.Coords}
JXG.Math.Geometry.projectPointToCurve(point, curve, board)
Calculates the coordinates of the projection of a given point on a given curve.
Uses #projectCoordsToCurve.
Defined in: geometry.js.
Defined in: geometry.js.
- 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:
- {JXG.Coords} The coordinates of the projection of the given point on the given graph.
- See:
- #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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {JXG.Point} point
- Point to project.
- {JXG.Line} line
- Line on that the point is projected.
- {JXG.Board} board Optional, Default: point.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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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>
{JXG.Coords}
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 #projectPointToCurve.
Defined in: geometry.js.
Defined in: geometry.js.
- 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:
- {JXG.Coords} The coordinates of the projection of the given point on the given 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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:
- #trueAngle
<static>
{JXG.Coords}
JXG.Math.Geometry.reflection(line, point, board)
Reflects the point along the line.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- Parameters:
- {Array} points
- Array of points which should be the vertices of the Reuleaux polygon. Typically, these point list is the array vrtices 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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-intersecting polygon.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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 point with the lowest y coordinate.
Defined in: geometry.js.
Defined in: geometry.js.
- 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.
Defined in: geometry.js.
Defined in: geometry.js.
- 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:
- #rad