All pastes #290335 Raw Edit

Miscellany

public c v1 · immutable
#290335 ·published 2006-12-23 22:25 UTC
rendered paste body
//returns a long containing the x and y rotated points as wordslong pointrot(short x, short y, short centerx, short centery, short rotate) {		//convert to coords based off polygon center as origin		short newx=x-centerx;		short newy=y-centery;				//xcos(t)-y*sin(t)		newx=((newx*sin128(90-rotate))/128)-((newy*sin128(rotate))/128);		newy=((newx*sin128(rotate))/128)+((newy*sin128(90-rotate))/128);				//convert back to LCD screen coords		return ((long)(newx+centerx)<<16)+(newy+centery);}