forked from DanielVartanov/ruby-geometry
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathREADME
More file actions
73 lines (37 loc) · 1.46 KB
/
README
File metadata and controls
73 lines (37 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
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