Include points at border in IsPointInRectangle
This commit is contained in:
parent
e832407ea0
commit
8041535b51
10
README.md
10
README.md
@ -8,14 +8,14 @@ the deployed release uses static linkage.
|
|||||||
## program arguments
|
## program arguments
|
||||||
```
|
```
|
||||||
-v mode with enabled visualization
|
-v mode with enabled visualization
|
||||||
-akl using Akl-Toussaint heuristic beforehand
|
--akl using Akl-Toussaint heuristic beforehand
|
||||||
https://en.wikipedia.org/wiki/Convex_hull_algorithms#Akl%E2%8
|
https://en.wikipedia.org/wiki/Convex_hull_algorithms#Akl%E2%8
|
||||||
-f <filename> read random numbers from file
|
-f <filename> read random numbers from file
|
||||||
-rngcount <count> generates count random float values
|
--rngcount <count> generates count random float values
|
||||||
-rngmode <mode> if generating float values this specifies the mode:
|
--rngmode <mode> if generating float values this specifies the mode:
|
||||||
1. random numbers in screen range
|
1. random numbers in screen range
|
||||||
2. numbers are ordered as rectangle
|
2. numbers are ordered as rectangle
|
||||||
3. numbers are ordered as circle around screen center
|
3. numbers are ordered as circle around screen center
|
||||||
-runs <count> runs performance mode multiple times
|
--runs <count> runs performance mode multiple times
|
||||||
-stepsize <size> time between autosteps; if 0 or not provided -> manual steps
|
--stepsize <size> time between autosteps; if 0 or not provided -> manual steps
|
||||||
```
|
```
|
||||||
|
@ -30,8 +30,8 @@ static bool IsPointInRectangle(const Point& pt, const Point& p1, const Point& p2
|
|||||||
float d3 = sign(pt, p3, p4);
|
float d3 = sign(pt, p3, p4);
|
||||||
float d4 = sign(pt, p4, p1);
|
float d4 = sign(pt, p4, p1);
|
||||||
|
|
||||||
bool has_neg = (d1 < 0) || (d2 < 0) || (d3 < 0) || (d4 < 0);
|
bool has_neg = (d1 <= 0) || (d2 <= 0) || (d3 <= 0) || (d4 <= 0);
|
||||||
bool has_pos = (d1 > 0) || (d2 > 0) || (d3 > 0) || (d4 > 0);
|
bool has_pos = (d1 >= 0) || (d2 >= 0) || (d3 >= 0) || (d4 >= 0);
|
||||||
|
|
||||||
return !(has_neg && has_pos);
|
return !(has_neg && has_pos);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user