blob: a40e2af6ecab96ca12058c4001470cbe6dff965a (
plain)
1
2
3
4
5
6
7
8
9
10
|
from geometry import *
ln1 = Line(Point(0,0), Point(1,2))
ln2 = Line(Point(1,1), Point(2,2))
assert gradient(ln1) == 2
assert gradient(ln2) == 1
assert intersection(ln1, ln2) == Point(0, 0)
assert intersection(ln1, ln1) is None
|