1
0
Fork
You've already forked vec-fork
0
forked from gwg/vec
↗️ Vectors for Gleam
  • Gleam 99.9%
2025年12月27日 07:05:09 +01:00
src add 'norm' as alias for 'length' 2025年12月27日 07:05:09 +01:00
test feat: Updated to 3.0.0 2025年09月25日 19:32:24 +07:00
.gitignore feat: Init. 2025年05月19日 00:11:58 +07:00
gleam.toml doc: Fixed README.md typo. 2025年09月25日 19:34:25 +07:00
manifest.toml fix: Update docs, remove gleam_community_maths depend, update test. 2025年08月07日 16:51:19 +07:00
README.md some README typos 2025年12月27日 07:04:53 +01:00

vec

Package Version Hex Docs

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, 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: