项目作者: elektronaut

项目描述 :
Ruby library (and gem) for handling two-dimensional vectors
高级语言: Ruby
项目地址: git://github.com/elektronaut/vector2d.git
创建时间: 2009-05-19T23:37:56Z
项目社区:https://github.com/elektronaut/vector2d

开源协议:MIT License

下载


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

  1. require 'vector2d'
  2. vector = Vector2d(50, 70)
  3. vector.aspect_ratio # => 0.714285714285714
  4. vector.length # => 86.0232526704263
  5. vector * 2 # => Vector2d(100,140)
  6. vector + Vector2d(20, 30) # => Vector2d(70,100)
  7. vector.fit(Vector2d(64, 64)) # => Vector2d(64,45)
  8. Vector2d.parse([50, 70]) # => Vector2d(50,70)
  9. Vector2d.parse("50x70") # => Vector2d(50,70)

Documentation

API documentation

License

Copyright (c) 2006-2019 Inge Jørgensen

Vector2d is released under the MIT License.