Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Simple geometry classes and algorithms in Ruby
branch: master

This branch is 43 commits behind DanielVartanov:master

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
lib
test
.gitignore
MIT-LICENSE
README
Rakefile
TODO

README

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

Implementation of basic 2D geometry algorithms in Ruby.


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

  * Point

  * Segment

  * Vector

  * Polygon


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

  * Do segments overlap? { Segments.overlaps? }

  * Do segments lie on one line? { Segment.lies_on_one_line_with? }

  * 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 }

  * Trivial vector arithmetics: summation, subtraction, vector-number multiplication { Vector.+(vector); Vector.-(vector); Vector.*(numeric) }

  * Euclid distance { Geometry.distance }


Coming up
=========

  * Is polygon self-intersecting?

  * Area of polygon

  * Is polygon convex?  

  * Do polygons intersect?

  * Does polygon contain given point?

  * Rectangular bounds 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
Something went wrong with that request. Please try again.