1
0
mirror of https://github.com/slendidev/smath.git synced 2026-03-17 02:26:50 +02:00

Compare commits

..

2 Commits

Author SHA1 Message Date
3b9adb0ddc Update README with logo
Add logo
2026-03-11 20:15:23 +02:00
889a42f9b5 Update README
Fix typo, add badges and add quick start section

Signed-off-by: Slendi <slendi@socopon.com>
2026-03-11 20:06:29 +02:00

View File

@@ -1,6 +1,43 @@
# smath
<p align="center">
<img alt="smath logo" src="https://github.com/user-attachments/assets/d6f2ef4b-eca0-4004-9099-37423528bcba" />
<br><br>
<a href="https://github.com/slendidev/smath/actions/workflows/build.yml">
<img src="https://github.com/slendidev/smath/actions/workflows/build.yml/badge.svg" alt="Build">
</a>
<a href="LICENSE.txt">
<img src="https://img.shields.io/badge/license-Apache%202.0-blue.svg" alt="License: Apache-2.0">
</a>
<a href="https://en.cppreference.com/w/cpp/23">
<img src="https://img.shields.io/badge/C%2B%2B-23-00599C.svg" alt="C++23">
</a>
</p>
Single-file, header-only linear algebra math library for C++23.
## Quick Start
Create `main.cpp`:
```cpp
#include <print>
#include <smath.hpp>
int main() {
using namespace smath;
Vec3 a{1.0f, 2.0f, 3.0f};
Vec3 b{3.0f, 2.0f, 1.0f};
std::println("a + b = {}", a + b);
std::println("dot(a, b) = {}", a.dot(b));
std::println("normalized(a) = {}", a.normalized());
}
```
Build and run:
```bash
g++ -std=c++23 -Iinclude main.cpp -o quickstart
./quickstart
```
## Features
@@ -12,8 +49,8 @@ Single-file, header-only linear algebra math library for C++23.
- Angle helpers `rad/deg/turns` respecting a configurable base unit via the macro `SMATH_ANGLE_UNIT`.
- Optional implicit conversions.
- Packing utilities for normalized RGBA (`pack_unorm4x8`, `unpack_snorm4x8`, etc.).
- C++20 modules support.
## License
This library is licensed under the Apache License 2.0. See the (LICENSE.txt)[LICENSE.txt] file for more details.
This library is licensed under the Apache License 2.0. See the [LICENSE.txt](LICENSE.txt) file for more details.