Stdlib module math/geometry.vitl

This page is a wiki-style reference for one concrete stdlib file. It explains what the file owns, where it fits in the family, and how to decide whether this is the right surface to depend on.

Visual portrait of math/geometry.vitl
Wiki-style portrait for math/geometry.vitl.

Family: math

Kind: public stdlib surface

Page style: this reference follows the same “encyclopedic card + portrait + usage contract” logic as the keyword pages, but for stdlib modules.

Summary

Overview

FieldValue
Pathmath/geometry.vitl
Familymath
Kindpublic stdlib surface
Line count618
Declared procedures72
Declared forms/picks0

`math/geometry.vitl` is a public stdlib surface inside the `math` family. It should be read as one focused slice of the broader family responsibility: Arithmetic, algebra, comparison, calculus, geometry, modular arithmetic, number theory, probability, statistics, matrix, and vector helpers.

Purpose

This file should be chosen because of responsibility, not because its name “sounds close enough”. Inside the math family, it carries one focused part of the contract and keeps that responsibility separate from neighboring concerns.

  • A scoring engine can compute aggregates in `math` while keeping I/O and transport elsewhere.
  • A statistics or matrix chapter should explain the workflow around the computation, not just a single formula.

Taxonomy

Think of this page as a generated encyclopedia entry rather than a hand-written tutorial. The goal is to show what kind of module this is, how dense it is, and what reading strategy makes sense before depending on it.

  • Large algorithm surface: this file exposes many procedures and likely acts as a domain toolkit rather than a single thin wrapper.
  • Has tuning constants: part of the module behavior is controlled by named constants that document default precision, limits, or policy.
  • Minimal top-level dependencies: the module reads as mostly self-contained from its opening declarations.
  • Explicit export surface: the file ends with visible export declarations instead of relying only on implicit namespace discovery.

Implementation profile

This profile is inferred directly from the source text. It does not replace reading the file, but it tells you quickly whether the module is mostly declarative, loop-heavy, branch-heavy, or organized around many small exits.

SignalCountWhat it suggests
if49Branching density and local decision-making.
while1Loop-heavy or iterative implementation style.
for0Collection-style traversal at source level.
match0Variant-driven branching or grammar-style decoding.
let61Local state and intermediate value density.
give120Number of explicit exit points and result shaping.

Top-level API inventory

SurfaceItems
Proceduresabs_int, min_int, max_int, clamp_int, sign_int, sqrt_floor, point2, vec2, point2_zero, point2_is_valid, point2_x, point2_y
Formsnone declared at top level
Picksnone declared at top level
ConstantsPI_TIMES_1000000
Exports*

Imported surfaces

This file does not advertise a top-level `use` surface in its opening declarations. That often means it is either self-contained or an aggregation layer.

Position in family

This file is module 8 of 21 in the math family when ordered by path. By procedure count it ranks 5, and by line count it ranks 9. Those ranks are useful as rough signals of breadth, not as quality judgments.

Declaration map

The declaration map turns raw source into a scan-friendly catalog. It is useful when the file is large enough that a reader wants to orient by kinds of surfaces first.

LineNameKindRole
1vitte/stdlib/math/geometryspaceDeclares the namespace that anchors this file in the stdlib tree.
7PI_TIMES_1000000constDefines a named constant reused across the module.
13abs_intprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
21min_intprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
29max_intprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
37clamp_intprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
49sign_intprocImplements a security-sensitive transformation in the crypto boundary.
61sqrt_floorprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
89point2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
93vec2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
97point2_zeroprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
101point2_is_validprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
105point2_xprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
113point2_yprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
121vec2_addprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
129vec2_subprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
137vec2_negprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
145vec2_scaleprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
153vec2_equalprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
161vec2_dotprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
169vec2_crossprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
177vec2_length_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
185vec2_manhattanprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
193vec2_chebyshevprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
201vec2_perp_leftprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
209vec2_perp_rightprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
217midpointprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
225midpoint_pointsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
237rect_areaprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
245rect_perimeterprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
254rect_is_validprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
258rect_containsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
266rect_intersectsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
290rect_intersection_areaprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
309rect_union_areaprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
321triangle_area2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
329triangle_areaprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
337triangle_area2_pointsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
346triangle_area_pointsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
352triangle_perimeter_manhattanprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
363distance_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
370distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
374manhattan_distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
383chebyshev_distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
392norm1procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
398norm2_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
402norm2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
406norm_infprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
412point_to_origin_distance_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
416point_to_origin_distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
424cross2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
428dot2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
432orientationprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
443collinearprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
447left_turnprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
451right_turnprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
459on_segmentprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
467segments_intersectprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
496segment_length_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
500segment_lengthprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
508circle_area_times_1000000procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
516circle_perimeter_times_1000000procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
524point_in_circleprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
536bbox2procRepresents one top-level surface in the file contract and should be read as part of the module boundary.
545bbox_containsprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
553bbox_widthprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
561bbox_heightprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
569bbox_areaprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
581l1_distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
585l2_distance_sqprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
589linf_distanceprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
593geometry_versionprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
597geometry_readyprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.
601geometry_selftestprocRepresents one top-level surface in the file contract and should be read as part of the module boundary.

The table is exhaustive for top-level declarations of the selected kinds. This file declares 74 matching surfaces.

Representative signatures

These signatures are shown in source order so the page keeps the feel of a reference manual, not just a keyword cloud.

  • const PI_TIMES_1000000: int = 3141592 (line 7)
  • proc abs_int(value: int) -> int { (line 13)
  • proc min_int(a: int, b: int) -> int { (line 21)
  • proc max_int(a: int, b: int) -> int { (line 29)
  • proc clamp_int(value: int, low: int, high: int) -> int { (line 37)
  • proc sign_int(value: int) -> int { (line 49)
  • proc sqrt_floor(value: int) -> int { (line 61)
  • proc point2(x: int, y: int) -> [int] { (line 89)
  • proc vec2(x: int, y: int) -> [int] { (line 93)
  • proc point2_zero() -> [int] { (line 97)
  • proc point2_is_valid(p: [int]) -> bool { (line 101)
  • proc point2_x(p: [int]) -> int { (line 105)
  • proc point2_y(p: [int]) -> int { (line 113)
  • proc vec2_add(a: [int], b: [int]) -> [int] { (line 121)
  • proc vec2_sub(a: [int], b: [int]) -> [int] { (line 129)
  • proc vec2_neg(v: [int]) -> [int] { (line 137)
  • proc vec2_scale(v: [int], k: int) -> [int] { (line 145)
  • proc vec2_equal(a: [int], b: [int]) -> bool { (line 153)

The list is intentionally capped here; the source file declares 73 matching signatures in total.

How to use this module

Start by reading the file as an ownership boundary. Ask three questions: what enters this module, what stable types or procedures it exports, and what adjacent module should stay outside of it.

  1. Read space and top-level imports first so the ownership boundary of math/geometry.vitl is explicit.
  2. Scan constants before procedures; they often encode precision, limits, or policy assumptions that explain later behavior.
  3. Traverse procedures in source order; the early helpers usually explain the naming and numeric conventions used later.
  4. Use the source landmarks section below as a table of contents when the file is large.
  5. Only after that compare neighbor modules, because the right boundary choice matters more than memorizing one helper name.

User example

This example is generated from the actual stdlib module surface. Its job is not to be the smallest snippet possible; its job is to show a realistic consumer-shaped file that exercises the module and mirrors the language keywords the module itself relies on.

space demo/math_geometry
const SAMPLE_LABEL: string = "demo"
proc run_example() -> string {
  let entries = point2(1, 1)
  let ready: bool = point2_is_valid([1, 2, 3])
  let failed: bool = false
  let stable: bool = ready and true
  let fallback: bool = ready or false
  let idx: int = 0
  let count: int = 0
  while idx < entries.len {
    set count = count + 1
    set idx = idx + 1
  }
  if not ready {
    give "not-ready"
  } else {
    give "ok"
  }
}
export run_example

Keyword coverage

This table makes the “all keywords of the module” requirement auditable. It compares the detected Vitte keywords in the source file with the generated consumer example above.

KeywordPresent in module sourceUsed in generated user example
spaceyesyes
constyesyes
procyesyes
letyesyes
setyesyes
ifyesyes
elseyesyes
whileyesyes
giveyesyes
exportyesyes
trueyesyes
falseyesyes
andyesyes
oryesyes
notyesyes

The generated snippet exercises every detected Vitte keyword used by this module.

Source shape

space vitte/stdlib/math/geometry
const PI_TIMES_1000000: int = 3141592
proc abs_int(value: int) -> int {
  if value < 0 {
    give 0 - value
  } else {
    give value
  }
}
proc min_int(a: int, b: int) -> int {

The excerpt is not meant to replace the file. It exists to make the module recognizable at first glance, the same way a Wikipedia infobox helps the reader orient before reading the whole article.

Source landmarks

Large files are easier to retain when they have visible landmarks. When the source contains explicit section banners, they are surfaced here; otherwise the first major declarations are used as anchors.

  • Geometry — 2D integer geometry helpers
  • Internal helpers
  • Points / vectors
  • Rectangles
  • Triangles
  • Distances and norms
  • Orientation / products
  • Segments
  • Circles
  • Bounding boxes

Source organization

When a file carries its own internal chaptering, those chapters usually reveal the intended reading order better than a flat symbol list. This section reconstructs that organization from the source itself.

Opening declarations

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 0.

First visible names: vitte/stdlib/math/geometry

Geometry — 2D integer geometry helpers

Top-level items: 1. Procedures: 0. Data surfaces: 0. Constants: 1.

First visible names: PI_TIMES_1000000

Internal helpers

Top-level items: 6. Procedures: 6. Data surfaces: 0. Constants: 0.

First visible names: abs_int, min_int, max_int, clamp_int, sign_int, sqrt_floor

Points / vectors

Top-level items: 20. Procedures: 20. Data surfaces: 0. Constants: 0.

First visible names: point2, vec2, point2_zero, point2_is_valid, point2_x, point2_y, vec2_add, vec2_sub, vec2_neg, vec2_scale

Rectangles

Top-level items: 7. Procedures: 7. Data surfaces: 0. Constants: 0.

First visible names: rect_area, rect_perimeter, rect_is_valid, rect_contains, rect_intersects, rect_intersection_area, rect_union_area

Triangles

Top-level items: 5. Procedures: 5. Data surfaces: 0. Constants: 0.

First visible names: triangle_area2, triangle_area, triangle_area2_points, triangle_area_points, triangle_perimeter_manhattan

Distances and norms

Top-level items: 10. Procedures: 10. Data surfaces: 0. Constants: 0.

First visible names: distance_sq, distance, manhattan_distance, chebyshev_distance, norm1, norm2_sq, norm2, norm_inf, point_to_origin_distance_sq, point_to_origin_distance

Orientation / products

Top-level items: 6. Procedures: 6. Data surfaces: 0. Constants: 0.

First visible names: cross2, dot2, orientation, collinear, left_turn, right_turn

Segments

Top-level items: 4. Procedures: 4. Data surfaces: 0. Constants: 0.

First visible names: on_segment, segments_intersect, segment_length_sq, segment_length

Circles

Top-level items: 3. Procedures: 3. Data surfaces: 0. Constants: 0.

First visible names: circle_area_times_1000000, circle_perimeter_times_1000000, point_in_circle

Bounding boxes

Top-level items: 5. Procedures: 5. Data surfaces: 0. Constants: 0.

First visible names: bbox2, bbox_contains, bbox_width, bbox_height, bbox_area

Aliases

Top-level items: 7. Procedures: 6. Data surfaces: 0. Constants: 0.

First visible names: l1_distance, l2_distance_sq, linf_distance, geometry_version, geometry_ready, geometry_selftest, *

Complete API catalog

This catalog is the exhaustive file-level index for the module. It is intentionally closer to a generated encyclopedia appendix than to a tutorial summary.

Constants

LineNameSignatureRole
7PI_TIMES_1000000const PI_TIMES_1000000: int = 3141592Defines a named constant reused across the module.

Procedures

LineNameSignatureRole
13abs_intproc abs_int(value: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
21min_intproc min_int(a: int, b: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
29max_intproc max_int(a: int, b: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
37clamp_intproc clamp_int(value: int, low: int, high: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
49sign_intproc sign_int(value: int) -> int {Implements a security-sensitive transformation in the crypto boundary.
61sqrt_floorproc sqrt_floor(value: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
89point2proc point2(x: int, y: int) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
93vec2proc vec2(x: int, y: int) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
97point2_zeroproc point2_zero() -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
101point2_is_validproc point2_is_valid(p: [int]) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
105point2_xproc point2_x(p: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
113point2_yproc point2_y(p: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
121vec2_addproc vec2_add(a: [int], b: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
129vec2_subproc vec2_sub(a: [int], b: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
137vec2_negproc vec2_neg(v: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
145vec2_scaleproc vec2_scale(v: [int], k: int) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
153vec2_equalproc vec2_equal(a: [int], b: [int]) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
161vec2_dotproc vec2_dot(a: [int], b: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
169vec2_crossproc vec2_cross(a: [int], b: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
177vec2_length_sqproc vec2_length_sq(v: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
185vec2_manhattanproc vec2_manhattan(v: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
193vec2_chebyshevproc vec2_chebyshev(v: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
201vec2_perp_leftproc vec2_perp_left(v: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
209vec2_perp_rightproc vec2_perp_right(v: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
217midpointproc midpoint(ax: int, ay: int, bx: int, by: int) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
225midpoint_pointsproc midpoint_points(a: [int], b: [int]) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
237rect_areaproc rect_area(width: int, height: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
245rect_perimeterproc rect_perimeter(width: int, height: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
254rect_is_validproc rect_is_valid(width: int, height: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
258rect_containsproc rect_contains(px: int, py: int, x: int, y: int, width: int, height: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
266rect_intersectsproc rect_intersects(ax: int, ay: int, aw: int, ah: int, bx: int, by: int, bw: int, bh: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
290rect_intersection_areaproc rect_intersection_area(ax: int, ay: int, aw: int, ah: int, bx: int, by: int, bw: int, bh: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
309rect_union_areaproc rect_union_area(ax: int, ay: int, aw: int, ah: int, bx: int, by: int, bw: int, bh: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
321triangle_area2proc triangle_area2(base: int, height: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
329triangle_areaproc triangle_area(base: int, height: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
337triangle_area2_pointsproc triangle_area2_points(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
346triangle_area_pointsproc triangle_area_points(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
352triangle_perimeter_manhattanproc triangle_perimeter_manhattan(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
363distance_sqproc distance_sq(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
370distanceproc distance(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
374manhattan_distanceproc manhattan_distance(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
383chebyshev_distanceproc chebyshev_distance(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
392norm1proc norm1(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
398norm2_sqproc norm2_sq(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
402norm2proc norm2(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
406norm_infproc norm_inf(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
412point_to_origin_distance_sqproc point_to_origin_distance_sq(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
416point_to_origin_distanceproc point_to_origin_distance(x: int, y: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
424cross2proc cross2(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
428dot2proc dot2(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
432orientationproc orientation(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
443collinearproc collinear(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
447left_turnproc left_turn(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
451right_turnproc right_turn(ax: int, ay: int, bx: int, by: int, cx: int, cy: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
459on_segmentproc on_segment(ax: int, ay: int, bx: int, by: int, px: int, py: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
467segments_intersectproc segments_intersect(ax: int, ay: int, bx: int, by: int, cx: int, cy: int, dx: int, dy: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
496segment_length_sqproc segment_length_sq(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
500segment_lengthproc segment_length(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
508circle_area_times_1000000proc circle_area_times_1000000(radius: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
516circle_perimeter_times_1000000proc circle_perimeter_times_1000000(radius: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
524point_in_circleproc point_in_circle(px: int, py: int, cx: int, cy: int, radius: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
536bbox2proc bbox2(ax: int, ay: int, bx: int, by: int) -> [int] {Represents one top-level surface in the file contract and should be read as part of the module boundary.
545bbox_containsproc bbox_contains(box: [int], px: int, py: int) -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
553bbox_widthproc bbox_width(box: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
561bbox_heightproc bbox_height(box: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
569bbox_areaproc bbox_area(box: [int]) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
581l1_distanceproc l1_distance(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
585l2_distance_sqproc l2_distance_sq(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
589linf_distanceproc linf_distance(ax: int, ay: int, bx: int, by: int) -> int {Represents one top-level surface in the file contract and should be read as part of the module boundary.
593geometry_versionproc geometry_version() -> string {Represents one top-level surface in the file contract and should be read as part of the module boundary.
597geometry_readyproc geometry_ready() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.
601geometry_selftestproc geometry_selftest() -> bool {Represents one top-level surface in the file contract and should be read as part of the module boundary.

Exports

LineNameSignatureRole
618*export *Re-exports surfaces that the module wants to expose as part of its public boundary.

Integration boundaries

Within math, this file should remain focused. If a future helper changes the host boundary, scheduling boundary, or data-shape boundary, it probably belongs in a neighbor module instead of being added here by convenience.

  • Family responsibility: Arithmetic, algebra, comparison, calculus, geometry, modular arithmetic, number theory, probability, statistics, matrix, and vector helpers.
  • Family architecture role: Use `math` when the transformation itself is the feature. This family exists so algorithmic intent stays visible and testable.

Composition guidance

Choose this module when

  • Choose math/geometry.vitl when the main question is owned by this module rather than by transport, storage, orchestration, or user-interface code.
  • A scoring engine can compute aggregates in `math` while keeping I/O and transport elsewhere.
  • A statistics or matrix chapter should explain the workflow around the computation, not just a single formula.

Pause before extending it when

  • Avoid extending this file when the new helper mostly changes the boundary to host I/O, runtime coordination, or foreign integration instead of staying inside math.
  • Check nearby modules such as math/algebra.vitl, math/arithmetic.vitl, math/arrays.vitl before adding convenience wrappers here.

Relationship table

This table keeps the page closer to a real encyclopedia entry: a module is easier to understand when compared with its nearest alternatives in the same family.

NeighborProceduresData surfacesWhy compare it
math/algebra.vitl140Shares the same family boundary but carries a distinct slice of responsibility.
math/arithmetic.vitl722Shares the same family boundary but carries a distinct slice of responsibility.
math/arrays.vitl832Shares the same family boundary but carries a distinct slice of responsibility.
math/calculus.vitl563Shares the same family boundary but carries a distinct slice of responsibility.
math/comparison.vitl470Shares the same family boundary but carries a distinct slice of responsibility.
math/complex.vitl490Shares the same family boundary but carries a distinct slice of responsibility.
math/logic.vitl200Shares the same family boundary but carries a distinct slice of responsibility.
math/matrix.vitl530Shares the same family boundary but carries a distinct slice of responsibility.

Neighbor modules