maths Archive
-
Scenegraphs are cool…
Posted on December 28, 2011 | No CommentsMany things are cool, like this screenshot of XCode for example… this is what happens when debugging iOS apps that use OpenGL, there’s a handy button to click that lets... -
Debugging via telepathy
Posted on October 20, 2011 | No CommentsSo after creating a fun little iOS game using OpenGL ES 1.1 I decided the next thing I create should use ‘real’ 3D, rather than simply bashing OpenGL into managing... -
Find opposite angle in radians
Posted on April 18, 2011 | No Comments// Finds the angle that is 180 degrees from the given angle, but in radians fmodf((angle + M_PI), (M_PI * 2)) -
LERP between angles in radians
Posted on March 16, 2011 | No Comments#include < stdio.h > #include < math.h > #define M_PI 3.141 #define PI180 (M_PI/180) #define DEG2RAD(x) (x * PI180) float getShortAngle(float a1, float a2) { float angle =... -
LERP
Posted on March 16, 2011 | No Comments// Between a and b, using steps of 'f' size float lerp(float a, float b, float f) { return a + f * (b - a); } // From http://stackoverflow.com/questions/4353525/floating-point-linear-interpolation -
Shortest distance between two angles
Posted on March 16, 2011 | No Commentsfloat getShortAngle(float a1, float a2) { float angle = abs(a1 - a2)%360; if(angle > 180) angle = 360 - angle; return angle; }; printf ("%f", getShortAngle(360, 720)); -
Basic calculus
Posted on August 5, 2009 | 2 CommentsI spent some of today learning basic, but useful calculus. There are various bits of maths that never made sense to me, and which seemed really complicated. For example working... -
This is why you learnt geometry at school
Posted on January 25, 2009 | 2 CommentsI spent this afternoon playing around with some basic school maths – calculating line/line intersections and distance from a point to a line stuff. And a little bit of vector...



