diff options
author | epoch <epoch@hacking.allowed.org> | 2017-04-18 01:33:44 -0500 |
---|---|---|
committer | epoch <epoch@hacking.allowed.org> | 2017-04-18 01:33:44 -0500 |
commit | a204330db26a0c3f5b4e88bdc495af350e262ab4 (patch) | |
tree | d92a57aca247f796c590eb5606ca64be4b8ed3af /src/math.c | |
parent | 34628f9a0df01adc1d17e44f569600dc7d9d1414 (diff) | |
download | hackvr-a204330db26a0c3f5b4e88bdc495af350e262ab4.tar.gz hackvr-a204330db26a0c3f5b4e88bdc495af350e262ab4.zip |
the changes needed to get tictactoe running pretty.
Diffstat (limited to 'src/math.c')
-rw-r--r-- | src/math.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -31,13 +31,19 @@ c3_t rotate_c3_zr(c3_t p1,c3_t p2,radians zr) {//rotate x and y around camera ba return (c3_t){tmp.x,tmp.y,p1.z}; } +//sin(0) = 0 +//sin(90deg) = 1 +//cos(0) = 1 +//cos(90deg) = 0 c2_t rotate_c2(c2_t p1,c2_t p2,radians dr) {//dr is in radians c2_t p3; real d=distance2(p1,p2); radians r=points_to_angle(p1,p2); r.r=r.r+dr.r; - p3.x=(sinl(r.r) * d) + p2.x; - p3.y=(cosl(r.r) * d) + p2.y; + p3.x=(sinl(r.r) * d) + p2.x;//switchiing this to cos and the next line to sin seems + p3.y=(cosl(r.r) * d) + p2.y;//to make some bug less weird. +// p3.x=(cosl(r.r) * d) + p2.x;//switchiing this to cos and the next line to sin seems +// p3.y=(sinl(r.r) * d) + p2.y;//to make some bug less weird. return p3; } real distance2(c2_t p1,c2_t p2) { |