//
// Created by Martin Gargalovič on 10. 9. 2021.
//

#ifndef ARC_SUPPORT_UTILITY_H
#define ARC_SUPPORT_UTILITY_H

/**
 * structure to store rectangle parameters
 */
struct rectangle {
    double x1, y1, x2, y2;  // first and second point of the line segment
    double width;        // rectangle width
    double x, y;          // center of the rectangle
    double theta;        // angle
    double dx, dy;        // (dx,dy) is vector oriented as the line segment
    double polarity;      // polarity of the line segment
};

/**
 * structure to store ellipse parameters
 */
struct ellipseParameters {
    cv::Point2i center; // center of an ellipse
    double major = 0; // semi major axis
    double minor = 0; // semi minor axis
    double theta = 0; // rotation of the ellipse
};



/**
 * @param x1 is x coordinate of first point
 * @param y1 is y coordinate of first point
 * @param x2 is x coordinate of second point
 * @param y2 is x coordinate of second point
 * @return Euclidean distance of 2 points
 */
double distance(const double x1, const double y1, const double x2, const double y2);


#endif //ARC_SUPPORT_UTILITY_H
