| Crates.io | cvmath |
| lib.rs | cvmath |
| version | 0.0.5 |
| created_at | 2018-03-07 21:10:06.563201+00 |
| updated_at | 2025-08-22 15:53:45.852397+00 |
| description | Computer Graphics Vector Math Library |
| homepage | |
| repository | https://github.com/CasualX/cvmath |
| max_upload_size | |
| id | 54416 |
| size | 2,814,708 |
Because reinventing the wheel is half the fun.

A path tracing scene using cvmath. See pathtracing.rs.
cvmath is a lightweight, graphics-oriented math library written in Rust. It focuses on vector math and geometric primitives commonly used in computer graphics. It is not a general-purpose numerical library.
If you're building 2D/3D renderers, ray tracers, or similar tools and want something compact and to the point, this might be a good fit.
The API is lean, clear, and practical.
All types are available at the crate root.
Vec2<T>, Vec3<T>, Vec4<T> — 2D, 3D, and 4D vectorsBool2, Bool3, Bool4 — Boolean vector masksAngle<T> — Angles in radiansComplex<T>, Polar<T>, Quat<T> — Complex numbers, polar coordinates, and quaternionsMat2<T>, Mat3<T>, Mat4<T> — General-purpose matricesTransform2<T>, Transform3<T> — Affine transformationsShapes are available in 2D and 3D variants.
Point2<T>, Point3<T> — 2D and 3D pointsBounds2<T>, Bounds3<T> — Axis-aligned bounding boxesPlane2<T>, Plane3<T> — Infinite planesCircle<T>, Sphere<T> — Defined by a center point and radiusLine2<T>, Line3<T> — Line segments defined by two pointsTriangle2<T>, Triangle3<T> — Triangles defined by three pointsShape2<T>, Shape3<T> — Generic shape enums for flexible compositionTypes involved in ray casting and intersection:
Ray2<T>, Ray3<T> — Rays defined by origin, direction, and max distanceHit2<T>, Hit3<T> — Intersection results (distance, normal, index)Trace2<T>, Trace3<T> — Traits for types that support ray tracingLicensed under the MIT License, see license.txt for details.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, shall be licensed as above, without any additional terms or conditions.