Moreover, many physical systems — such as those pertained with body move around a central point or with phenomenon originate from a central point — are simpler and more intuitive to model use polar coordinates. The initial motivation for the introduction of the polar system was the survey of circular and orbital movement. Bernoulli's work extended to finding the radius of curvature of curves expressed in these coordinates. In the journal Acta Eruditorum (1691), Jacob Bernoulli used a system with a point on a line, named the pole and polar axis respectively. The calculation is essentially the conversion of the equatorial polar coordinates of Mecca (i.e. its longitude and latitude) to its polar coordinates (i.e. its qibla and distance) relative to a system whose reference meridian is the great circle through the given location and the Earth's poles, and whose polar axis is the line through the location and its antipodal point.

COMING SOON!

```
#include <stdio.h>
#include <math.h>
const double pi = 3.141592653589793238462643383279502884;
/**
give as arguments to the executable two x and y coordinates
outputs a polar coordinate
**/
int main() {
double x, y;
double r, theta, thetaFinal;
scanf("%lf %lf", &x, &y);
r = hypot(x, y);
if (x != 0) {
if (y != 0) {
theta = atan(y / x);
if ((x > 0 && y > 0) || (x == -y)) { //Q1
thetaFinal = theta;
} else if (x < 0 && y > 0) { //Q2
thetaFinal = theta + pi;
} else if (x < 0 && y < 0) { //Q3
thetaFinal = theta - pi;
} else if (x > 0 && y < 0) { //Q4
thetaFinal = 2 * pi - theta;
}
}
}
if (x == 0) { //exceptions when no actual angle is present
if (y > 0) {
thetaFinal = pi / 2;
} else {
thetaFinal = -(pi / 2);
}
}
if (y == 0) {
if (x > 0) {
thetaFinal = 0;
} else {
thetaFinal = -pi;
}
}
printf("%.2f %.2f\n", r, atan2(y, x));
}
```