| 4259 | ////////////////////// RotatedRect ////////////////////// |
| 4260 | |
| 4261 | void RotatedRect::points(Point2f pt[]) const |
| 4262 | { |
| 4263 | double _angle = angle*CV_PI/180.; |
| 4264 | float b = (float)cos(_angle)*0.5f; |
| 4265 | float a = (float)sin(_angle)*0.5f; |
| 4266 | |
| 4267 | pt[0].x = center.x - a*size.height - b*size.width; |
| 4268 | pt[0].y = center.y + b*size.height - a*size.width; |
| 4269 | pt[1].x = center.x + a*size.height - b*size.width; |
| 4270 | pt[1].y = center.y - b*size.height - a*size.width; |
| 4271 | pt[2].x = 2*center.x - pt[0].x; |
| 4272 | pt[2].y = 2*center.y - pt[0].y; |
| 4273 | pt[3].x = 2*center.x - pt[1].x; |
| 4274 | pt[3].y = 2*center.y - pt[1].y; |
| 4275 | } |
| 4276 | |
| 4277 | Rect RotatedRect::boundingRect() const |
| 4278 | { |
no outgoing calls
no test coverage detected