ApasScript.

Coordinate Geometry

point

Constructs a 2D point. With three numbers, a 3D point: point(1, 2, 3).

line

Constructs a 2D line in general form a*x + b*y + c = 0; line(P, Q) is the line through two points. In 3D, line(p, l, m, n) is the line through point p with direction ratios l, m, n, shown in symmetric form.

lineFromPoints

Constructs the line through two points. With two 3D points, the 3D line through them.

lineFromSlope

Constructs the line y = m*x + k from a slope and y-intercept.

linePointSlope

Constructs the line through a point with a given slope.

lineFromAngle

Constructs an infinite line through a point at a direction in degrees. Positive angles are counter-clockwise from +x; negative angles clockwise.

lineFromIntercepts

Constructs the line with given x- and y-intercepts.

lineVertical

Constructs the vertical line x = k.

lineHorizontal

Constructs the horizontal line y = k.

circle

Constructs a circle from a centre point and radius.

ellipse

Constructs an axis-aligned ellipse from a centre point and horizontal/vertical semi-axis lengths. The value works with the conic-section functions: eccentricity, foci, vertices, tangentAt, normalAt, ...

circleFromGeneral

Constructs a circle from its general-form coefficients (x^2 + y^2 + 2gx + 2fy + c = 0).

ratios

Constructs a 3D direction ratios value (l, m, n) -- unnormalized direction cosines.

midpoint

The midpoint of two points. Also works for two 3D points.

sectionInternal

The point dividing segment pq internally in the ratio m:n. Also works for two 3D points.

sectionExternal

The point dividing segment pq externally in the ratio m:n. Also works for two 3D points.

collinear

True if three points lie on a common line. Also works for three 3D points.

distance

The distance between two values: point-point, point-line (either order), line-line (parallel only), or circle-circle (between centres). In 3D: point-point, point-line, point-plane, line-line (shortest distance) and between parallel planes.

intersect

The intersection of two values: line-line (a point, or explanatory text if parallel/coincident) or line-circle (either order). Also for two planes: their line of intersection, or text if they are parallel. Also the intersection of two sets.

positionOf

A point's position relative to a line ("above"/"on"/"below") or a circle ("inside"/"on"/"outside").

areParallel

True if two lines, or two direction ratios, are parallel. Also for two 3D lines or two planes.

arePerpendicular

True if two lines, or two direction ratios, are perpendicular. Also for two 3D lines.

angleBetweenLines

The angle, in radians, between two lines, or between two direction ratios. Also for two 3D lines (radians).

slope

The slope of a line. Returns explanatory text for a vertical line.

yIntercept

A line's y-intercept. Returns explanatory text for a vertical line.

xIntercept

A line's x-intercept. Returns explanatory text for a horizontal line.

isVertical

True if a line is vertical.

isHorizontal

True if a line is horizontal.

areCoincident

True if two lines are the same line. Also for two planes.

footOfPerpendicular

The foot of the perpendicular from a point to a line. In 3D: from a point to a 3D line or to a plane.

imageOfPoint

The mirror image of a point reflected across a line. In 3D: the mirror image of a point in a plane.

familyThroughIntersection

A line in the family l1 + lambda*l2 passing through the intersection of two lines.

parallelThrough

The line through a point, parallel to a given line.

perpendicularThrough

The line through a point, perpendicular to a given line.

sameSide

True if two points lie on the same side of a line.

circleArea

The area of a circle.

circumference

The circumference of a circle.

diameter

The diameter of a circle.

radiusSq

The square of a circle's radius.

tangentAt

The tangent line to a circle at a point on it. Also for a parabola, ellipse or hyperbola and a point on it.

radicalAxis

The radical axis of two circles.

relativePosition

How two circles relate to each other (e.g. "intersecting", "concentric", "one inside the other").

triangleArea

The area of the triangle formed by three points.

triangleAreaSigned

The signed area of the triangle formed by three points -- positive for counterclockwise winding, negative for clockwise.

isDegenerate

True if three points are collinear (form a degenerate triangle with zero area). With one conic() value: true if the conic is degenerate (a pair of lines, a point, ...).

classify

Classifies a triangle formed by three points (e.g. "equilateral", "isosceles", "right-angled").

perimeter

The perimeter of the triangle formed by three points.

centroid

The centroid of the triangle formed by three points. Also works for three or four 3D points.

incentre

The incentre of the triangle formed by three points.

circumcentre

The circumcentre of the triangle formed by three points. Returns explanatory text for a degenerate triangle.

orthocentre

The orthocentre of the triangle formed by three points. Returns explanatory text for a degenerate triangle.

eulerLine

The Euler line of the triangle formed by three points (through the centroid, orthocentre, and circumcentre). Returns explanatory text for a degenerate triangle.

ninePointCentre

The nine-point centre of the triangle formed by three points. Returns explanatory text for a degenerate triangle.

sideA

The length of side a (opposite p) of the triangle formed by three points.

sideB

The length of side b (opposite q) of the triangle formed by three points.

sideC

The length of side c (opposite r) of the triangle formed by three points.

toCosines

Converts direction ratios to direction cosines, as a 3-element array.

ratioDot

The dot product of two direction ratios.

ratioMagSq

The squared magnitude of a direction ratios value.

generalForm

g, f, c of a circle written as x^2 + y^2 + 2gx + 2fy + c = 0.