geo/ directory

Geometric objects and operations over them.


euclidean.xqy ("http://mathling.com/geometric")

Basic Euclidean geometric operations (some are not yet implemented for all region types). Entry point for generic operations over regions. Affine and projective operations. Intersections/containment/interpolations. Bounding boxes and circles.


hyperbolic.xqy ("http://mathling.com/geometric/hyperbolic")

Hyperbolic tesselation onto Poincaré disk plus constructors for hyperbolic edges.


transform.xqy ("http://mathling.com/geometric/transform")

Transformation (2D) accumulator. Object that can collect a chain of affine transforms together and generate a matrix suitable for use in an SVG transform attribute.


random.xqy ("http://mathling.com/geometric/random")

Random point generation: Cartesian, polar, and Poisson disk sampling.


curves.xqy ("http://mathling.com/geometric/curve")

Parametric curve computations. 2D and 3D Cartesian and polar, dependent, and complex variants.


point.xqy ("http://mathling.com/geometric/point")

Point objects; 2D and 3D and 4D.

Basic operations over points/vectors: distance, normalization, dot and cross products, addition and subtraction, point at distance along angle or angle + inclination, triplet orientation.

Points have two kinds of accessors: "precision" accessors that return the raw double coordinates, and basic accessors which snap the coordinates to integer values.

Points are maps of coordinates which may be decorated with other properties (e.g. for rendering). There are also methods for dealing with the point coordinates as sequences: these exist mainly for efficiency in certain cases (see noise modules and core/vector).


edge.xqy ("http://mathling.com/geometric/edge")

Edges: including arcs, quads, and cubics.

Basic operations over edges: length, angle, inclination, interpolations, point on edge, etc.

Edges are decorated with properties which art infrastructure may care about for rendering purposes.


path.xqy ("http://mathling.com/geometric/path")

Path and polygon (closed path) objects.

Basic operations: length, interpolations, area, etc.


rectangle.xqy ("http://mathling.com/geometric/rectangle")

A bit of a misnomer: Axis-aligned rectangles, not generic rectangles (those are polygons).

There are two basic types:

Basic operations: extents, area, center, point-in-box, etc.


box.xqy ("http://mathling.com/geometric/box")

Axis-aligned spaces, separated out from rectangle.xqy for code-partitioning reasons.


ellipse.xqy ("http://mathling.com/geometric/ellipse")

Ellipses (including circles).

Basic operations: area, perimeter, point in region, etc.


graph.xqy ("http://mathling.com/geometric/graph")

Representation of a graph as vertices + edges. Tables of in-edges and out-edges make them a little expensive to update, more efficient for certain kinds of traversals.


solid.xqy ("http://mathling.com/geometric/solid")

Solids: regular tetrahedrons, cubes, octahedrons, dodecahedrons, icosahedrons, ellipsoids (and spheres).

Basic construction, some basic operations (mainly for the Platonic solids only) such surface area, volume, circumsphere, midsphere, insphere.


complex-polygon.xqy ("http://mathling.com/geometric/complex-polygon")

Polygons with holes.

Basic operations: length, interpolations, area, etc.


affine.xqy ("http://mathling.com/geometric/affine")

Basic affine support: the point level matrices etc.


intersection.xqy ("http://mathling.com/geometric/intersection")

Region intersection tests.


projection.xqy ("http://mathling.com/geometric/projection")

Isometric, stereographic, and 3-point projection.


simplify.xqy ("http://mathling.com/geometric/simplify")

Path simplification.


spline.xqy ("http://mathling.com/geometric/spline")

Spline calculation.

Inspired by David J. Birnbaum's https://github.com/djbpitt/plot

This differs from that fairly substantially:


coordinates.xqy ("http://mathling.com/geometric/coordinates")

Coordinate mapping: bipolar, parabolic, circular, etc.


point-map.xqy ("http://mathling.com/geometric/point-map")

A hash map for points. Use point-matrix if you want to map x/y relationships into matrix.


point-matrix.xqy ("http://mathling.com/geometric/matrix")

A sparse point matrix, mapping points to values. Includes operations to get values for all points in the same row or column, or within a neighbourhood of the point.


splittree.xqy ("http://mathling.com/geometric/tree/split")

Binary split trees.

Each node has at most two children containing the points of the parent split along the midpoint of the longest axis. These are 2-dimensional only.

Requires bug fix in Saxon 10.6.


treemap.xqy ("http://mathling.com/geometric/treemap")

Squarified tree map. See https://www.win.tue.nl/~vanwijk/stm.pdf


wspd.xqy ("http://mathling.com/geometric/wspd")

Well-separated pair-wise decomposition of a split tree, plus some things you can do with that, e.g. a spanner.


arf.xqy ("http://mathling.com/geometric/graph/arf")

Graph layout using ARF (attaction + repulsion force). Input is set of points plus a sequence of connection pairs (arrays) as indexes into the point sequence. Output is either a full graph or just the new set of points.


conrec.xqy ("http://mathling.com/geometric/conrec")

Contour generation, a port/expansion of Paul Bourke's CONREC algorithm, along with a fairly naive edge-following algorithm to stitch edges at the same contour levell together.


marching-triangles.xqy ("http://mathling.com/geometric/marching")

Alternative contouring algorithm: tends to be faster but messier than CONREC.


delaunay.xqy ("http://mathling.com/geometric/delaunay")

Delaunay triangulation of a set of points using Bowyer-Watson with ordered pruning optimization.

I'm not entirely happy with this implementation. Bowyer-Watson is a straightforward algorithm, but sensitive to boundary conditions and roundoff issues. As written, I set the bounding circle slightly small so the triangle vertices fall outside it. This leads to interior triangles: getting pruned leading to holes. Using the full bounding circle leads to some exterior points being missed. I resolve this by hackery: checking pruned interior triangles and reinstating them.

Calculation of Voronoi dual from the Delaunay triangulation.


kml.xqy ("http://mathling.com/geometric/kml")

Very basic and incomplete parsing of KML to geometric objects.


pixels.xqy ("http://mathling.com/geometric/pixels")

Basic drawing onto a pixel array.


makers.xqy ("http://mathling.com/geometric/maker")

(Experimental) Maker functions for basic geometric objects.


mutation.xqy ("http://mathling.com/geometric/mutation")

Definition for mutation callables. (See components/mutations)


Copyright© Mary Holstege 2020-2024

CC-BY (https://creativecommons.org/licenses/by/4.0/)