↗️ Vectors for Gleam (moved to GwG)
https://codeberg.org/gwg/vec
This repository has been archived on 2026年01月08日 . You can view files and clone it, but you cannot make any changes to its state, such as pushing and creating new issues, pull requests or comments.
- Gleam 99.9%
| src | Remove all 'norm' alias | |
| test | feat: Updated to 3.0.0 | |
| .gitignore | feat: Init. | |
| gleam.toml | feat: Updated ver. | |
| manifest.toml | fix: Update docs, remove gleam_community_maths depend, update test. | |
| README.md | docs: Added Kaplay to README.md | |
vec
This is a vectors library for the Gleam programming language.
Features
- Supports 2D/3D/4D vectors.
- Have StdLib's quality, from design and naming convention to documentation and tests.
- Functionality comparable to the things that you can do with vectors in Godot, Kaplay, Phaser and Bevy.
- All vector types are generic:
- Gives users the freedom to have any kind of vector (integer vector, float vector, rational vector, ...).
- And it's more convenient to handle (e.g: function-mapping).
Installation
gleam add vec
importvec/vec3.{Vec3}importvec/vec3ipubfnmain(){Vec3(12,-34,420)|>vec3i.add(Vec3(21,45,-20))|>echo// -> Vec3(33, 11, 400)
|>vec3i.scale(2)|>echo// -> Vec3(66, 22, 800)
}Further documentation can be found at https://hexdocs.pm/vec.
Credits
Special thanks to: