Skip to content

Commit

Permalink
Add test case for floating point representation error in angle2() fix…
Browse files Browse the repository at this point in the history
…ed in 2dd5bb.

See also: #28, #19, 2dd5bb
  • Loading branch information
TaipanRex committed Apr 15, 2018
1 parent ede25f8 commit bbf379e
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions tests/test_pvg.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,28 @@ def test_angle_function():
assert degrees(angle(center, point_f)) == 225


"""This tests for floating point representation errors"""
def test_angle2_function():
polys = [[Point(353.6790486272709, 400.99387840984855),
Point(351.1303807396073, 398.8696192603927),
Point(349.5795890382704, 397.8537806679034),
Point(957.1067811865476, -207.10678118654744),
Point(-457.10678118654766, -207.10678118654744),
Point(-457.10678118654744, 1207.1067811865476),
Point(957.1067811865476, 1207.1067811865473),
Point(353.52994294901674, 606.0798841165788),
Point(354.0988628008279, 604.098862800828),
Point(354.52550331744527, 601.3462324760635),
Point(352.6969055662087, 602.6943209889012),
Point(351.22198101804634, 603.781672670995),
Point(247.0, 500.0),
Point(341.8964635104416, 405.50444716676054),
Point(349.24224903733045, 410.671256247085),
Point(350.84395848060774, 407.17766877398697)]]
v = vg.VisGraph()
v.build(polys)


def test_edge_intersect_function():
point_a = Point(3.0, 5.0)
point_b = Point(5.0, 3.0)
Expand Down

0 comments on commit bbf379e

Please sign in to comment.