shapes-math alternatives and similar packages
Based on the "Math" category.
Alternatively, view shapes-math alternatives based on common mentions on social networks and blogs.
-
vector
An efficient implementation of Int-indexed arrays (both mutable and immutable), with a powerful loop optimisation framework . -
hgeometry
HGeometry is a library for computing with geometric objects in Haskell. It defines basic geometric types and primitives, and it implements some geometric data structures and algorithms. The main two focusses are: (1) Strong type safety, and (2) implementations of geometric algorithms and data structures that have good asymptotic running time guarantees. -
dimensional
Dimensional library variant built on Data Kinds, Closed Type Families, TypeNats (GHC 7.8+). -
numhask
A haskell numeric prelude, providing a clean structure for numbers and operations that combine them. -
poly
Fast polynomial arithmetic in Haskell (dense and sparse, univariate and multivariate, usual and Laurent) -
eigen
Haskel binding for Eigen library. Eigen is a C++ template library for linear algebra: matrices, vectors, numerical solvers, and related algorithms.
WorkOS - The modern identity platform for B2B SaaS
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of shapes-math or a related project?
README
shapes
physics engine and other tools for 2D shapes
https://youtu.be/DYzf4zBK90o?list=PLmozfF6FosKjmPMnlPoVbWosiExbD0SUF
About
shapes
started out as my second Haskell project. I'm still working on it.
Libraries
shapes-math
: TemplateHaskell-generated vector math using GHC primops (in place oflinear
)shapes
: physics engine implementationshapes-demo
: interactive demo and debugging tool forshapes
Engine Components
- Contact: find contacts between shapes - e.g. Separating Axis Test (
SAT
) - Constraint: general form (and solution) for constraints on motion of objects
- Solver: solving the set of all constraints in a world
- Broadphase: finding potential interactions (that would give rise to constraints)
How the Solver works
start at Physics.Engine.Main
- Broadphase: Compare axis-aligned bounding boxes (
Aabb
) to find pairs of objects that may be interacting. Feed these pairs into the solver. - Generate constraint generators.
* Calculate contacts between a pair of objects (`SAT`).
* Create generators for relevant constraints at each contact (e.g. `Friction`, `NonPenetration`)
* Constraint generators are evaluated with the objects' current state (see 4, Note).
- For each constraint generator that also existed in the previous frame, apply the previous frame's constraint solution.
- Evaluate and solve each constraint generator in sequence. (Optional: repeat this step)
Note: Solving a constraint affects the velocity of the object(s).