Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <dlib/geometry.h>
- #include <dlib/numeric_constants.h>
- using namespace std;
- using namespace dlib;
- int main(void) {
- // dlib::line object
- line lA = line(dpoint(0, 2), dpoint(5, 0));
- line lB = line(dpoint(-5, 5), dpoint(3, -7));
- dpoint pA = dpoint(1.5, 3.5);
- cout << lB.normal() << endl;
- cout << intersect(lA, lB) << endl;
- cout << angle_between_lines(lA, lB) * pi / 180 << endl;
- cout << signed_distance_to_line(lA, pA) << endl;
- // polygon_area
- std::vector<dpoint> polygon;
- polygon.push_back(dpoint(1.0, 1.0));
- polygon.push_back(dpoint(1.0, -4.0));
- polygon.push_back(dpoint(3.0, -5.0));
- polygon.push_back(dpoint(3.0, -2.0));
- cout << polygon_area(polygon) << endl;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement