forked from seangransee/ruby-geometry
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Daniel Vartanov
committed
Nov 15, 2008
1 parent
89a290b
commit f7e3fff
Showing
3 changed files
with
41 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
== Auxiliary features | ||
* Methods requests tagging | ||
|
||
If algorithm requires some state or property of object, it should be tagged. | ||
Requirements should be checked before each method call (of course, info should | ||
be cached due to computational complexity of algorithms). | ||
Example: | ||
|
||
class Polygon | ||
|
||
def convex? | ||
... | ||
end | ||
|
||
def self_intersecting? | ||
... | ||
end | ||
|
||
must_be :convex | ||
must_not_be :self_intersecting | ||
def contains_point?(point) | ||
... # code, which assumes, that polygon is convex and not self_intersecting | ||
end | ||
|
||
== Algorithms | ||
|
||
* Polygon convexity | ||
* Polygons intersection | ||
* Polygon contains given point? | ||
* Rectangular bounds of polygon | ||
* Area of polygon | ||
* Does circle contain given point? | ||
* Do circles intersect? | ||
* Area of circle | ||
* Making a ruby gem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters