diff options
author | epoch <epoch@hacking.allowed.org> | 2017-11-04 04:22:32 -0500 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2017-11-04 04:22:32 -0500 |
commit | 570679c333af5d7505d94876d7011664e465dc4b (patch) | |
tree | bf134f7155fdda6e56725f383a2ead955bcbc318 /src/math.c | |
parent | 6c639891311eed4e82f9145ff24d16f4d44a0f0a (diff) | |
download | hackvr-570679c333af5d7505d94876d7011664e465dc4b.tar.gz hackvr-570679c333af5d7505d94876d7011664e465dc4b.zip |
added radians to degrees function
Diffstat (limited to 'src/math.c')
-rw-r--r-- | src/math.c | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -49,6 +49,10 @@ real distance2(c2_t p1,c2_t p2) { return sqrtl(( (p1.x-p2.x)*(p1.x-p2.x) )+( (p1.y-p2.y)*(p1.y-p2.y) )); } +degrees r2d(radians r) { + return (degrees){(r.r * (real)180 / M_PIl) }; +} + radians d2r(degrees d) { while(d.d<0) d.d+=360; return (radians){(real)(d.d%360) / (real)180 * M_PIl}; |