Move through space
Vec2, Vec3, and Vec4 types with direction helpers.
Linear algebra · 2D and 3D
Ruby math types for graphics: vectors, matrices, quaternions, and colors.
gem install larb
Build from vectors, compose matrices, and represent rotation with quaternions.
Vec2, Vec3, and Vec4 types with direction helpers.
Matrix and affine-transform types for graphics.
Quaternions, dual quaternions, and color helpers.
A small first step
Install the gem, then follow the project guide for platform requirements and the full API.
require "larb"
position = Larb::Vec3.new(1, 2, 3)
direction = Larb::Vec3.up
rotation = Larb::Quat.from_axis_angle(direction, Math::PI / 4)
rotated = rotation * position
transform = Larb::Mat4.translation(10, 20, 30)