GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


rotate by DELTRON
1
 
// given a point (x,y), to find a new point (newx,newy) rotated around a given center by 'degrees':

    dx = aboutx - x;
    dy = abouty - y;
    newx = dx * cos(degrees) - dy * sin(degrees) + aboutx;
    newy = dx * sin(degrees) + dy * cos(degrees) + abouty;