-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathComplementary.cpp
More file actions
30 lines (25 loc) · 887 Bytes
/
Complementary.cpp
File metadata and controls
30 lines (25 loc) · 887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "Complementary.h"
#include "math.h"
bool IsDotInRect(float x, float y, FloatRECT rect) {
return x >= rect.left && x <= rect.right && y >= rect.top && y <= rect.bottom;
}
BoolRECT FindOccurrences(FloatRECT target, FloatRECT incoming) {
BoolRECT result;
result.leftUp = IsDotInRect(incoming.left, incoming.top, target);
result.leftDown = IsDotInRect(incoming.left, incoming.bottom, target);
result.rightUp = IsDotInRect(incoming.right, incoming.top, target);
result.rightDown = IsDotInRect(incoming.right, incoming.bottom, target);
return result;
}
std::string ConvertIntToString(int value) {
std::stringstream s;
s << std::scientific << value;
return s.str();
}
float ConvertDegToRad(float value) {
return value * M_PI / 180;
}
long ConvertStringToLong(std::string str) {
if (str == "") return 0;
return std::stol(str);
}