Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
jtauber committed Jan 29, 2013
1 parent 8af5352 commit e5fdef1
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/usr/bin/env python


from folds import *

v1 = Vertex(0, 0, 0)
v2 = Vertex(0, 1, 0)


assert quadrance(v1, v2) == 1


e1 = Edge(v1, v2)

assert e1.quadrance() == 1


v3 = Vertex(0, 2, 0)
v4 = Vertex(1, 0, 0)

assert collinear(v1, v2, v3) == True
assert collinear(v1, v2, v4) == False


v5 = Vertex(1, 2, 0)
v6 = Vertex(2, 0, 0)

e2 = (v1, v6)

assert foot_of_altitude(v5, e2) == v4

0 comments on commit e5fdef1

Please sign in to comment.