Skip to content

purchease/ruby-geometry

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Geometry in Ruby
================

Implementation of basic 2D geometry algorithms in Ruby.


Defined geometry objects
========================

* Point

* Segment

* Vector


Already implemented algorithms
==============================

  * Do segments intersect? { Segment.intersects_with? }

  * Segments intersection point { Segment.intersection_point_with }

  * Does segment contain given point?  { Segment.contains_point? }

  * Are segments parallel? { Segment.parallel_to? }

  * Are vectors collinear? { Vector.collinear_with? }

  * Vectors cross product (outer product, vector product) { Vector.cross_product }

  * Vectors scalar product (inner product, dot product) { Vector.scalar_product }

  * Segment length { Segment.length }

  * Vector modulus { Vector.modulus }

  * Euclid distance { Geometry.distance }


In progress
===========

  * Trivial vector arithmetics


Coming up
=========        

  * Does polygon contain given point?

  * Do polygons intersect?

  * Rectangular bounds of polygon

  * Area of polygon

  * Does circle contain given point?

  * Do circles intersect?

  * Area of circle

  * Making a ruby gem
  

Copyright (c) 2008 Daniel Vartanov, released under the MIT license

About

Simple geometry classes and algorithms in Ruby

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published