Skip to content

Instantly share code, notes, and snippets.

@pixaline
Created May 20, 2017 23:46
Show Gist options
  • Save pixaline/88d78aaa57bbd56dcb76706df150b596 to your computer and use it in GitHub Desktop.
Save pixaline/88d78aaa57bbd56dcb76706df150b596 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
int main(int argc, char ** argv)
{
double res = 0;
float x = 0;
if(argc == 2)
x = strtof(argv[1], NULL);
res = 90.0 - x;
if(res < 0.0)
res += 360.0;
res *= (M_PI/180.0);
printf("%.2f = %.6f radians\n", x, res);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment