Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bugfix: handle problems acos arg > 1 #33

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Commits on May 23, 2018

  1. bugfix: handle problems acos arg > 1

    While processing the shoreline set GSHHS_c_L1 with 742 shapes a
    problem was encountered where cos_value = 1.00000000000048 which meant
    that the acos raised an ValueError: math domain error and the graph
    could not be built.
    
    This patch checks if the arguments are very close to -1 or 1 and returns
    the expected values. If the values are not close to either of these
    values the ValueError is still raised.
    
    point_a   = (112.96, -25.49)
    point_b   = (45.00, -25.49)
    point_c   = (45.00, -25.49)
    a         = 6.938890000001394e-07
    b         = 4618.002849783456
    c         = 4618.11606498842
    cos_value = 1.00000000000048
    T         = 10000000000000
    T2        = 10000000000000.0
    tjansson60 committed May 23, 2018
    Configuration menu
    Copy the full SHA
    fa5c6e1 View commit details
    Browse the repository at this point in the history