Rotating Vectors

BlitzMax Forums/BlitzMax Programming/Rotating Vectors

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Ah yes a good ole Matrix. In fact I lied as my TVector type has this method:

	Method Rotate(angle!) 'clockwise
		Local tx# = (x * Cos(angle)) - (y * Sin(angle))
		Local ty# = (x * Sin(angle)) + (y * Cos(angle))	
		x=tx
		y=ty
	End Method

But I like the way Big10p is storing the cos and sin before the main calc to reduce the number of calls to cos and sin. Wonder if it's faster creating those two extra local variables. I guess a test is in order.