# @holotope/core

Zero-dependency N-dimensional geometry kernel: vectors, matrices, and exterior
products in any dimension, plane rotations and the so(n) exponential map, a paired-quaternion
`Rotor4` fast path with slerp, N-D rigid transforms and cameras, cell
complexes, polytope builders (n-cube, simplex, orthoplex, all six regular
polychora, duoprisms — the simplex and orthoplex author any requested face
family via `maxCellDimension`, through the top simplex or the orthoplex's
whole simplicial boundary; authored groups are combinatorial and unoriented,
so render double-sided and derive oriented boundaries from the section path), perspective/orthographic/coordinate-subspace N→3 projection with Float64
homogeneous evaluation, explicit inverse fibres, and perspective-correct
segment/triangle lifting, an injective R2→R3 plane embedding
(`PlaneEmbedding3D`: `[x, y] → [x, y, 0]` exactly, a unique typed inverse on
its image, no fibre — render products consume the common `DisplayMap3D`
contract, of which `Projection` is the lossy specialization), and exact
hyperplane slicing via marching tetrahedra with source-edge interpolation
provenance. A renderer-independent
representation layer adds dimension-checked map lineage, capability-sensitive
hit results, auditable in-memory source-cell references, and explicit
dimension-independent cell-incidence queries and source-edge coordinates plus multi-view source-parameter
consensus for constrained interaction. A deterministic linear coordinate-
constraint solver gives edge and barycentric source-simplex coordinates one
shared vocabulary for compatibility, rank, unresolved degrees, conditioning,
and residual certificates while leaving each coordinate domain explicit.
Immutable named constraint-system snapshots add stable replacement/removal and
keyed diagnostics without introducing editor state. The simplex path extends
this to multi-view homogeneous triangulation. Its
structured-space layer also
includes the exact 240-root E8 orbit and the icosian folding into conjugate
4-spaces, plus exact cut-and-project lattices, flats, convex windows, and
finite model-set patches, including complete-shell Elser–Sloane sections.
The implicit-field layer adds inspectable quaternion and bicomplex Julia
families, deterministic packed-point and affine-slice sampling, and an
approximate isosurface extractor whose full evaluation records remain available.
Exact Airbrot, Firebrot, and Earthbrot specifications independently cover the
Platonic parameter slices of the tricomplex Mandelbrot set. The coupling layer
adds provenance-driven parameter decorations, including the canonical
Elser–Sloane internal-coordinate map and an exact finite-orbit equivariance
checker for its H4 action. `SkewProductFlow` adds state-dependent SO(4) fiber
dynamics with periodic-orbit closure and holonomy reports.
The spectral layer provides a deterministic symmetric eigensolver plus sparse
unweighted graph Laplacians, connected components, complete modal bases, and
basis-independent repeated-mode projectors for any `CellComplex` 1-skeleton.

`createHypercube()` preserves its established edge/face/cube output by default.
Set `maxCellDimension` to author higher cuboid cells explicitly; for example, a
full tesseract then contains one 16-vertex 4-cell. `simplexizeCuboidGroupN()`
applies the dimension-generic Kuhn decomposition to any binary-ordered cuboid
group, returning k! simplices per k-cell plus exact parent-cell and local-
permutation provenance. `tetrahedralizeCuboidCells()` remains the compatible
three-dimensional convenience wrapper over that kernel.

Renderable coordinates run in Float64 on the CPU, while supported lattice,
window, and group decisions stay in exact quadratic rings. The kernel is renderer-agnostic; pair it with
[`@holotope/three`](https://www.npmjs.com/package/@holotope/three) to render
with three.js.

**[Live showcase](https://nikilp.github.io/holotope.js/)** ·
**[Repository & docs](https://github.com/nikilp/holotope.js)**

```ts
import { HyperplaneSlice4, create600Cell, sliceTetrahedra } from '@holotope/core';

const cell600 = create600Cell({ radius: 1.5 });
const slice = HyperplaneSlice4.axisAligned(3, 0); // the w = 0 hyperplane
// ...march its tetrahedra into an exact 3D cross-section
```

Sections are also dimension-generic. `HyperplaneSliceN` is the affine chart in
any RN — its ambient dimension is inferred from its normal — and
`sectionSimplexGroupN` cuts a group of simplicial k-cells with it into
`(k-1)`-simplices. A section is an *intersection*, not a projection: it is
injective on what it keeps and loses dimension rather than distinctness, which
is why a section point can name its source and a projected pixel often cannot.
(An *embedding* is the third kind of display map and loses nothing at all —
see `PlaneEmbedding3D` for R2 content.)
Every output vertex carries a sparse affine combination of **original** source
vertices, so cutting an already-sectioned complex still names the geometry a
reader started from rather than the intermediate one.

MIT © Nikolay Petrov
