Hisab
Hisab (Arabic: حساب — calculation) — higher mathematics library for AGNOS
Higher math for the AGNOS ecosystem. Provides typed mathematical operations — linear algebra, geometry, calculus, and numerical methods — built on glam. Used by impetus (physics), kiran (game engine), and joshua (simulation).
For expression evaluation and unit conversion, see abaco.
Features
| Feature | Default | Description |
|---|---|---|
transforms |
yes | 2D/3D affine transforms, projections, slerp, lerp, glam re-exports |
geo |
yes | Primitives, intersections, BVH, k-d tree, quadtree, octree, spatial hash, GJK/EPA |
calc |
yes | Differentiation, integration, Bezier 2D/3D, splines, easing, Gauss-Legendre |
num |
yes | Root finding, LU/Cholesky/QR, eigenvalues, FFT, RK4 ODE solver |
ai |
no | Daimon/hoosh AI client (network deps) |
logging |
no | Structured logging via HISAB_LOG env var |
full |
— | Enables all features |
Modules
| Module | Description |
|---|---|
transforms |
Transform2D, Transform3D, projections, slerp, lerp, handedness conversion |
geo |
Ray, Plane, Aabb, Sphere, Triangle, Line, Segment, Frustum, Bvh, KdTree, Quadtree, Octree, SpatialHash, ConvexPolygon, GJK/EPA collision |
calc |
derivative, integration (trapezoidal, Simpson, Gauss-Legendre), Bezier 2D/3D, Catmull-Rom, B-spline, de Casteljau, arc-length, easing functions |
num |
newton_raphson, bisection, gaussian_elimination, LU/Cholesky/QR, least_squares_poly, eigenvalue_power, Complex, FFT/IFFT, rk4 ODE solver |
ai |
DaimonClient for AGNOS daimon/hoosh integration |
Quick Start
[]
= "0.22"
use ;
use ;
use integral_simpson;
use ;
// 3D transform
let t = new;
let world_pos = t.apply_to_point;
// Ray-sphere intersection
let ray = new;
let sphere = new;
let hit = ray_sphere; // Some(4.0)
// Numerical integration
let area = integral_simpson; // ~0.3333
// Root finding
let sqrt2 = newton_raphson.unwrap;
Building
Roadmap
See docs/development/roadmap.md for the full plan through V2.0.
License
GPL-3.0 — see LICENSE.