Fix step depth in grahamGetCHSteps
If we have 3 points and pass 1 to 'g' then 2 steps will be computed. That means we have to substract 2 from the total length in the call to 'g'.
This commit is contained in:
parent
5ce94d36aa
commit
4877837f93
@ -69,7 +69,7 @@ grahamGetCH vs = f . grahamSort $ vs
|
||||
-- |Compute all steps of the graham scan algorithm to allow
|
||||
-- visualizing it.
|
||||
grahamGetCHSteps :: [PT] -> [[PT]]
|
||||
grahamGetCHSteps vs = reverse . g $ (length . grahamGetCH $ vs)
|
||||
grahamGetCHSteps vs = reverse . g $ (length vs - 2)
|
||||
where
|
||||
vs' = grahamSort vs
|
||||
g c
|
||||
|
Loading…
Reference in New Issue
Block a user