Project

vector2d

0.01
Low commit activity in last 3 years
No release in over a year
Vector2d allows for easy handling of two-dimensional coordinates and vectors
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies
 Project Readme

Version Build Code Climate Code Climate

Vector2d

Vector2d handles two-dimensional coordinates and vectors. Vectors are immutable, meaning this is a purely functional library.

Quick example

require 'vector2d'

vector = Vector2d(50, 70)

vector.aspect_ratio        # => 0.714285714285714
vector.length              # => 86.0232526704263

vector * 2                 # => Vector2d(100,140)
vector + Vector2d(20, 30)  # => Vector2d(70,100)

vector.fit(Vector2d(64, 64)) # => Vector2d(64,45)

Vector2d.parse([50, 70])   # => Vector2d(50,70)
Vector2d.parse("50x70")    # => Vector2d(50,70)

Documentation

API documentation

License

Copyright (c) 2006-2019 Inge Jørgensen

Vector2d is released under the MIT License.