Myrddin Dundragon fbef05fcd1 [#2] Cleaned up the base traits.
I have switched to using the `core::` calling convention instead of using
the `std::` by means of `extern crate core as std`. This makes it so
that the library is easier to reason.

The `Number` trait has been broken up now into `Number` and `Natural`.
This was done to make it so that the pure mathematical types were
separate from the Rust implementation types.

I went and added better comments, including examples.

The macros were tightened up so that the implementations took up less
space.

The FromNumber and ToNumber stuff will need to be reimplemented yet.
Some of it seemed redundant with From and TryFrom traits now. It will be
something to come back to and implement at the end.
2026-02-12 19:21:53 -05:00
2026-02-12 19:21:53 -05:00
2026-02-12 09:40:19 -05:00
2025-07-29 12:38:11 -04:00
2025-07-29 12:38:11 -04:00

Sigils

sigils is a trait-driven Rust math library offering vector, quaternion, and numeric abstractions for simulation, graphics, and systems-level development.

It focuses on performance, generic correctness, and ergonomic APIs without sacrificing type safety or precision.


Features

  • Generic Vector and Quaternion trait abstractions
  • Implementation of common 2D and 3D types (Vec2, Vec3, Quat)
  • Traits for scalar math operations on floats and integers
  • Designed for zero-cost abstractions and compiler optimization
  • Suited for simulation, embedded graphics, and procedural tools

Motivation

Simulation, game, and physics systems often need mathematical primitives with predictable behavior, performance, and strong type guarantees.

sigils exists to provide just that, core math abstractions without the complexity or bloat of large game engines or math suites.


Getting Started

First, add the CyberMages registry to your Cargo config:

[registries.cybermages]
index = "sparse+https://workshop.cybermages.tech/api/packages/CyberMages/cargo/"

Then add sigils to your dependencies:

[dependencies]
sigils = { version = "0.1", registry = "cybermages" }

Example Usage

TODO: Rotate a Vector with a Quaternion.

Documentation

Documentation can be generated locally with:

cargo doc --open

Design Highlights

  • Uses traits to decouple math concepts from specific types
  • Scalar math via trait constraints allows use of f32, f64, or custom types
  • Encourages composability across simulation and rendering domains
  • Small and dependency-free core, easy to embed or extend

Notes

The code in this library uses macros pretty heavily. As such, please check the trait's documentation for a function since the macro definition will not really be documented. This was not done to make documentation difficult, but to make coding the library easier and to make it easier to maintain.


Copyright 2015 CyberMages LLC

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this library except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS

Description
High-performance no_std linear algebra for simulations and embedded flight systems.
Readme 144 KiB
Languages
Rust 100%