Hisab
Hisab (Arabic: حساب — calculation) — higher mathematics library for AGNOS
Higher math for the AGNOS ecosystem. Provides typed mathematical operations — linear algebra, geometry, calculus, numerical methods, automatic differentiation, symbolic algebra, and more — built on glam.
Used by impetus (physics), kiran (engine), joshua (simulation), and aethersafha (compositor).
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, 2D+3D GJK/EPA, OBB, Capsule |
calc |
yes | Differentiation, integration (Simpson, Gauss-Legendre, adaptive, Monte Carlo), Bezier, splines, easing, gradient/jacobian/hessian |
num |
yes | Root finding, LU/Cholesky/QR/SVD, FFT/DST/DCT, optimization (GD, CG, BFGS, L-BFGS, LM), ODE (RK4, DOPRI45), sparse matrices |
autodiff |
no | Forward-mode automatic differentiation (dual numbers) |
interval |
no | Interval arithmetic for verified numerics |
symbolic |
no | Symbolic expression tree with evaluation, differentiation, simplification |
tensor |
no | N-dimensional dense tensor type |
parallel |
no | Rayon-powered parallel batch operations |
ai |
no | Daimon/hoosh AI client (network deps) |
logging |
no | Structured logging via HISAB_LOG env var |
full |
— | Enables all features |
Quick Start
[]
= "1"
use ;
use ray_sphere;
use integral_simpson;
use newton_raphson;
// 3D transform
let t = new;
let world_pos = t.apply_to_point;
// Ray-sphere intersection
let ray = new.unwrap;
let sphere = new.unwrap;
let hit = ray_sphere; // Some(4.0)
// Numerical integration
let area = integral_simpson.unwrap; // ~0.3333
// Root finding
let sqrt2 = newton_raphson.unwrap;
Building
License
GPL-3.0-only — see LICENSE.