diff --git a/coordinate_conversion.cpp b/coordinate_conversion.cpp index 06c5663..bbb99a4 100644 --- a/coordinate_conversion.cpp +++ b/coordinate_conversion.cpp @@ -11,7 +11,7 @@ void polar_to_cartesian(double radius, double angle, double *xCoordinate, void cartesian_to_polar(double xCoordinate, double yCoordinate, double *radius, double *angle) { *radius = std::sqrt(std::pow(xCoordinate, 2) + std::pow(yCoordinate, 2)); - *angle = std::atan(xCoordinate); + *angle = std::atan(xCoordinate / yCoordinate); } #endif // COORDINATE_CONVERSION_H