# Stamp is a error? (Documentation Bugs and Problems)

I think the "stamp", does not work well.?

The rotation of the figure is not 2D.

There is an image deformation.

Is that right?

Or my program is error!!!

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

clg
graphsize 600,600
color blue
for n = 0 to 360 step 10
pause 0.5
clg
stamp 300, 300, 1,r, {0, 0, 100, 100, 0, 100}
next n

:::::::::::::::::::::::::::::::::::::::::::::::::::::::::

Perfect rotation 2D

::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

GLOBAL T_CENTER_SCREEN_X, T_CENTER_SCREEN_Y
GLOBAL T_POSITION_X,T_POSITION_Y
GLOBAL T_ORIENTATION, T_PEN, T_DISTANCE
GLOBAL T_NEW_POSITION_X, T_NEW_POSITION_Y
GLOBAL T_LAST_POSITION_X, T_LAST_POSITION_Y
GLOBAL T_FIRST_POSITION_X, T_FIRST_POSITION_Y
GLOBAL T_X0, T_Y0, TX1, T_Y1, T_NG

CLS : CLG : PX = 500 : PY = 500 : GRAPHSIZE PX, PY

#Example

CALL T_INIT ()
for n = 0 to 360 step 10
clg
PAUSE 0.1
CALL T_GT (0,0)
CALL T_ORIENTATION (n)

FOR X = 1 TO 3
CALL T_FD (100)
CALL T_RT (120)
NEXT X

NEXT n

END

#::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#LIB TURTLE

SUBROUTINE T_GT (X,Y)
#GO TO NEW POSITION X,Y
T_NEW_POSITION_X = T_CENTER_SCREEN_X + X
T_NEW_POSITION_Y = T_CENTER_SCREEN_Y + Y
IF T_PEN = 1 THEN LINE T_POSITION_X, T_POSITION_Y, T_NEW_POSITION_X,T_NEW_POSITION_Y
T_POSITION_X = T_NEW_POSITION_X
T_POSITION_Y = T_NEW_POSITION_Y
END SUBROUTINE

SUBROUTINE T_RT (GRA)
#TURN RIGHT
T_ORIENTATION = T_ORIENTATION + RADIANS (GRA)
END SUBROUTINE

SUBROUTINE T_FD (T_DISTANCE)
#FORWARD X DISTANCE
T_NEW_POSITION_X = T_POSITION_X + ( T_DISTANCE * SIN (T_ORIENTATION))
T_NEW_POSITION_Y = T_POSITION_Y - ( T_DISTANCE * COS (T_ORIENTATION))
IF T_PEN = 1 THEN LINE T_POSITION_X, T_POSITION_Y, T_NEW_POSITION_X,T_NEW_POSITION_Y
T_POSITION_X = T_NEW_POSITION_X
T_POSITION_Y = T_NEW_POSITION_Y
END SUBROUTINE

FUNCTION T_ORIENTATION (GRA)
#SHOW ORIENTATION
END FUNCTION

SUBROUTINE T_INIT ()
#INIT TURTLE
T_CENTER_SCREEN_X = INT (Graphwidth / 2)
T_CENTER_SCREEN_Y = INT (Graphheight / 2)
T_POSITION_X = T_CENTER_SCREEN_X
T_POSITION_Y = T_CENTER_SCREEN_Y
T_ORIENTATION = 0
T_PEN = 1
END SUBROUTINE

## Stamp is a error?

there has been a bug found and it will be repaired in the next binary release. I got a bit heavy handed in optimizing the scale and rotate code. the release should be this weekend.

thanks for the report

Ok, Thanks!

## Stamp is a error?

Just pushed the binary 0.9.9.46 with the fix to Sourceforge - see my posting on the release.