ok, sorry. Here I made a working example for you.
' declare all vars, fixed size arrays.
option static
option explicit
' screen size
const xres=800
const yres=600
' x offset ;
dim shared halfx as integer = (xres/2)
' y offset;
dim shared halfy as integer = (yres/2)
' set up 4 points.
dim shared as integer points=4
dim shared as double xp(points)
dim shared as double yp(points)
dim as integer a
for a=1 to 4
read xp(a),yp(a)
next
#include "tinyptc.bi"
declare sub rotate_draw()
dim shared as uinteger buffer (xres*yres)
IF( PTC_OPEN( " + SAREK + ", XRES, YRES ) = 0 ) THEN
END -1
END IF
while(1)
rotate_draw()
ptc_update@buffer(0)
erase buffer
wend
sub rotate_draw()
dim as double MO1,MO2, THETA,nnn,mmm
dim as integer x,tx,ty
' convert 1 radian to 1 degree;
theta=1*3.14/180
MO1= COS( THETA ):' GENERATE MATRIX CONSTANT 1
MO2= SIN ( THETA ):' GENERATE MATRIX CONSTANT 2
FOR X=1 TO POINTS
'-----------------------------------------------------------------------
' ROTATE
'-----------------------------------------------------------------------
NNN= XP (X)
MMM=YP (X)
XP(X) = MO1 * NNN - MO2 * MMM
YP(X) = MO1 * MMM + MO2 * NNN
' transform;
tx=(xp(x)*20)+halfx
ty=(yp(x)*20)+halfy
' plot;
if tx>0 and tx<xres and ty>0 and ty<yres then
buffer(tx+(ty*xres))=&hffffff
end if
NEXT
end sub
' points data;
data -10,-10,10,-10,10,10,-10,10