Skip to main content
Commonmark migration
Source Link

#C, 88 bytes

C, 88 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return atan2(b-y,a-x)*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

#C, 88 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return atan2(b-y,a-x)*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

C, 88 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return atan2(b-y,a-x)*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

deleted 1 character in body
Source Link
user45941
user45941

#C, 8988 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return( atan2(b-y,a-x))*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

#C, 89 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return(atan2(b-y,a-x))*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

#C, 88 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return atan2(b-y,a-x)*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

updated online link
Source Link
user45941
user45941

#C, 9589 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return(atan2(b,a)-atan2(y,a-x))*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it onlineTry it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

#C, 95 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return(atan2(b,a)-atan2(y,x))*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

#C, 89 bytes

#include<math.h> typedef double d;d g(d x,d y,d a,d b){return(atan2(b-y,a-x))*180/M_PI;} 

Requires compiling with GCC to take advantage of M_PI being defined in math.h as a part of GCC's built-in math constants. Try it online - since ideone doesn't use GCC (apparently), an additional few bytes are needed for enough digits of π to be accurate.

Source Link
user45941
user45941
Loading