Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int GetAngleABC(Point a, Point b, Point c)
- {
- Point ab = { b.x - a.x, b.y - a.y };
- Point cb = { b.x - c.x, b.y - c.y };
- float dot = (ab.x * cb.x + ab.y * cb.y); // dot product
- float cross = (ab.x * cb.y - ab.y * cb.x); // cross product
- float alpha = atan2(cross, dot);
- return (int)floor(alpha * 180.0 / CV_PI + 0.5);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement