And you were using cos function wrong.
You don't even know what COS, SIN, TG, CTG, ARCCOS, ARCSIN and all the freakin trigonometry works.
Just give a basic questions and we'll show how stuff works.
 
  CS2D
 CS2D  Scripts
 
Scripts  Mathematic
 Mathematic Mathematic
 Mathematic CAN
 CAN  use these functions in CS2D!
 use these functions in CS2D! SQ posted already!
 SQ posted already!  
  function fwdcalc(rot,x,y,factor) 	if rot<-90 then rot=rot+360 end 	local angle=math.rad(math.abs(rot+90))-math.pi 	local cx=x+(math.cos(angle)*factor) 	local cy=y+(math.sin(angle)*factor) 	return cx,cy end
 SQ:
 SQ: DEG_TO_RAD = 0.0174532925199432957692369076848861 math.cos(ANGLE*DEG_TO_RAD)
math.cos(math.rad(ANGLE))