Home » Archimedes archive » Archimedes World » AW-1994-03-Disc1.adf » Disk1Mar94 » !AWMar94/Goodies/Basic/!PathLib/Library/OS_units/Transforms » Compare

Compare !AWMar94/Goodies/Basic/!PathLib/Library/OS_units/Transforms with !AWApr94/Goodies/Basic/!PathLib/Library/OS_units/Transforms

File: Archimedes archive » Archimedes World » AW-1994-03-Disc1.adf » Disk1Mar94 » !AWMar94/Goodies/Basic/!PathLib/Library/OS_units/Transforms
Compared with: Archimedes archive » Archimedes World » AW-1994-04-Disc1.adf » Disk1Apr94 » !AWApr94/Goodies/Basic/!PathLib/Library/OS_units/Transforms
Similarity: 97% of bytes duplicated

61 of 66 lines (96.1%) are identical in the two listings. Duplicated Different

Line numbers are ignored when comparing lines, so that renumbered programs still match.

!AWMar94/Goodies/Basic/!PathLib/Library/OS_units/Transforms !AWApr94/Goodies/Basic/!PathLib/Library/OS_units/Transforms
1REM > PathLib:OS_units.Transforms 1REM > PathLib:OS_units.Transforms
2 2
3DEF PROCPath_Transform(RETURN path%,transform%) 3DEF PROCPath_Transform(RETURN path%,transform%)
4 REM -------------------------------------- 4 REM --------------------------------------
5 REM Recalculates path% by using transform% 5 REM Recalculates path% by using transform%
6 REM -------------------------------------- 6 REM --------------------------------------
7 SYS "Draw_TransformPath",path%,0,transform%,0 7 SYS "Draw_TransformPath",path%,0,transform%,0
8 ENDPROC 8 ENDPROC
9 9
10DEF PROCPath_CreateTransform(RETURN transform%) 10DEF PROCPath_CreateTransform(RETURN transform%)
11 REM ------------------------------------------- 11 REM -------------------------------------------
12 REM Creates byte array for transform: 12 REM Creates byte array for transform:
13 REM 13 REM
14 REM X=ax+by+e , Y=cx+dy+f 14 REM X=ax+by+e , Y=cx+dy+f
15 REM 15 REM
16 REM where 16 REM where
17 REM a=transform%!0 b=transform%!4 17 REM a=transform%!0 b=transform%!4
18 REM c=transform%!8 c=transform%!12 18 REM c=transform%!8 c=transform%!12
19 REM 19 REM
20 REM e=transform%!16 f=transform%!20 20 REM e=transform%!16 f=transform%!20
21 REM -------------------------------------------- 21 REM --------------------------------------------
22 LOCAL i% 22 LOCAL i%
23 DIM transform% 6*4 23 DIM transform% 6*4
24 FOR i%=0 TO 20 STEP 4 : transform%!i%=0 : NEXT 24 FOR i%=0 TO 20 STEP 4 : transform%!i%=0 : NEXT
25 transform%!0=1<<16 : transform%!12=1<<16 25 transform%!0=1<<16 : transform%!12=1<<16
26 ENDPROC 26 ENDPROC
27 27
28 28
29DEF PROCPath_Translation(transform%,dx%,dy%) 29DEF PROCPath_Translation(transform%,dx%,dy%)
30 REM --------------------- 30 REM ---------------------
31 REM Creates a translation 31 REM Creates a translation
32 REM I.e. calculates e,f 32 REM I.e. calculates e,f
33 REM --------------------- 33 REM ---------------------
34 transform%!16=dx%*256 : transform%!20=dy%*256 34 transform%!16=dx%*256 : transform%!20=dy%*256
35 ENDPROC 35 ENDPROC
36 36
37DEF PROCPath_Magnify(transform%,m) 37DEF PROCPath_Magnify(transform%,m)
38 REM --------------------------------- 38 REM ---------------------------------
39 REM Magnifies 39 REM Magnifies
40 REM I.e. 40 REM I.e.
41 REM - - - - 41 REM - - - -
42 REM | a b | = m * | a b | 42 REM | a b | = m * | a b |
43 REM | c d | | c d | 43 REM | c d | | c d |
44 REM - - - - 44 REM - - - -
45 REM --------------------------------- 45 REM ---------------------------------
46 transform%!0=m*(transform%!0) : transform%!4=m*(transform%!4) 46 transform%!0=m*(transform%!0) : transform%!4=m*(transform%!4)
47 transform%!8=m*(transform%!8) : transform%!12=m*(transform%!12) 47 transform%!8=m*(transform%!8) : transform%!12=m*(transform%!12)
48 ENDPROC 48 ENDPROC
49 49
50DEF PROCPath_Rotation(transform%,theta) 50DEF PROCPath_Rotation(transform%,theta)
51 REM --------------------------------- 51 REM ---------------------------------
52 REM Creates a rotation 52 REM Creates a rotation
53 REM I.e. 53 REM I.e.
54 REM a=COStheta b=SINtheta 54 REM a=COStheta b=SINtheta
55 REM c=-SINtheta d=COStheta 55 REM c=-SINtheta d=COStheta
56 REM --------------------------------- 56 REM ---------------------------------
57 c%=INT(COStheta*2^16+.5) : s%=INT(SINtheta*2^16+.5) 57 c%=INT(COStheta*2^16+.5) : s%=INT(SINtheta*2^16+.5)
58 transform%!0=c% : transform%!4=s% 58 transform%!0=c% : transform%!4=s%
59 transform%!8=-s% : transform%!12=c% 59 transform%!8=-s% : transform%!12=c%
60 ENDPROC 60 ENDPROC
61 61
62DEF PROCPath_Transform(path%,transform%,RETURN output%)
63LOCAL next%
64SYS "Draw_TransformPath",path%,output%,transform%
65ENDPROC
66