You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have found a trouble. For u in function directOf when sing > 0 return RIGHT.
This are extract from Cross Product from http://en.wikipedia.org/wiki/Graham_scan and in this case when sign > 0 you must return LEFT. For understand it better you can draw a three points, after that join P3 and P1 if u are doing the same direction that a clock you are going to Right, else you are going to Left (less when u cant build the triangle). Then the function should be:
directionOf a v b
| sign > 0 = LEFT
| sign < 0 = RIGHT
| otherwise = STRAIGHT
where sign = (x v - x a) * (y b - y a) - (y v - y a) * (x b - x a)
The text was updated successfully, but these errors were encountered:
Chapter 3 - Excercices -10 11 12
Hi guys,
I have found a trouble. For u in function directOf when sing > 0 return RIGHT.
This are extract from Cross Product from http://en.wikipedia.org/wiki/Graham_scan and in this case when sign > 0 you must return LEFT. For understand it better you can draw a three points, after that join P3 and P1 if u are doing the same direction that a clock you are going to Right, else you are going to Left (less when u cant build the triangle). Then the function should be:
directionOf a v b
| sign > 0 = LEFT
| sign < 0 = RIGHT
| otherwise = STRAIGHT
where sign = (x v - x a) * (y b - y a) - (y v - y a) * (x b - x a)
The text was updated successfully, but these errors were encountered: