Skip to content

Commit

Permalink
Hotfix floating point representation error discovered in angle2()
Browse files Browse the repository at this point in the history
Still seeing some errors so reduced the COLIN_TOLERANCE from 13 to 10.
This solves the specific example given in #33 and I also mentioned
in #28 that I would reduce the tolerance to better avoid these types
of errors.

@tjansson60 has a suggested solution that does not involve truncating
the cos_value, I need to performance test this first.

See: #33, #28, #19
  • Loading branch information
TaipanRex committed May 30, 2018
1 parent b7c876e commit 93ea677
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pyvisgraph/visible_vertices.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
INF = 10000
"""Due to floating point representation error, some functions need to
truncate floating point numbers to a certain tolerance."""
COLIN_TOLERANCE = 13
COLIN_TOLERANCE = 10
T = 10**COLIN_TOLERANCE
T2 = 10.0**COLIN_TOLERANCE

Expand Down

0 comments on commit 93ea677

Please sign in to comment.