A5/GeometryUtils.h

41 lines
1.3 KiB
C
Raw Normal View History

2024-11-06 17:02:59 -07:00
#ifndef GEOMETRY_UTILS_H
#define GEOMETRY_UTILS_H
#include "Coordinate.h"
2024-11-18 00:16:40 -07:00
2024-11-06 17:02:59 -07:00
#include <limits>
/**
2024-11-18 00:16:40 -07:00
* @brief Compares two doubles to see if they are equal, within the system
* epsilon range
*
2024-11-06 17:02:59 -07:00
* @param first The first value to compare
* @param second The second value to compare
* @return true The values are equal
* @return false The values are not equal
*/
bool double_eq(double first, double second);
/**
* @brief Calculates the distance between two coordinate points
2024-11-18 00:16:40 -07:00
*
2024-11-06 17:02:59 -07:00
* @param firstPoint The first coordinate point to calculate the distance of
* @param secondPoint The second coordinate point to compare the first to
* @return double The pythagorean distance between the two points
*/
double calculate_distance(Coordinate& firstPoint, Coordinate& secondPoint);
2024-11-06 17:02:59 -07:00
/**
2024-11-18 00:16:40 -07:00
* @brief Returns true if all of the side lengths in the specified array make a
* triangle
*
2024-11-06 17:02:59 -07:00
* @param sideOne The first side to check for "triangle-ness"
* @param sideTwo The second side to check for "triangle-ness"
* @param sideThree The third side to check for "triangle-ness"
2024-11-18 00:16:40 -07:00
*
2024-11-06 17:02:59 -07:00
* @return true The side lengths do make a geometrically sound triangle
* @return false The side lengths do not make a geometrically sound triangle
*/
bool lengths_make_triangle(double sideOne, double sideTwo, double sideThree);
#endif // GEOMETRY_UTILS_H