Wiki page
[Affine Transform] by
sandro
2015-05-23 11:40:18.
0000: 44 20 32 30 31 35 2d 30 35 2d 32 33 54 31 31 3a D 2015-05-23T11:
0010: 34 30 3a 31 38 2e 39 38 39 0a 4c 20 41 66 66 69 40:18.989.L Affi
0020: 6e 65 5c 73 54 72 61 6e 73 66 6f 72 6d 0a 50 20 ne\sTransform.P
0030: 36 30 65 33 34 63 64 66 64 64 63 61 62 65 36 39 60e34cdfddcabe69
0040: 39 66 63 65 63 63 35 63 35 30 62 65 33 32 39 66 9fcecc5c50be329f
0050: 65 39 35 37 63 35 64 30 0a 55 20 73 61 6e 64 72 e957c5d0.U sandr
0060: 6f 0a 57 20 33 38 34 32 31 0a 3c 61 20 68 72 65 o.W 38421.<a hre
0070: 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e 67 f="https://www.g
0080: 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 73 69 aia-gis.it/fossi
0090: 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 65 2f l/libspatialite/
00a0: 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32 2e 30 2d wiki?name=4.2.0-
00b0: 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e 0d 0a 3c doc">back</a>..<
00c0: 68 32 3e 41 66 66 69 6e 65 20 54 72 61 6e 73 66 h2>Affine Transf
00d0: 6f 72 6d 61 74 69 6f 6e 73 3c 2f 68 32 3e 0d 0a ormations</h2>..
00e0: 53 74 61 72 74 69 6e 67 20 73 69 6e 63 65 20 76 Starting since v
00f0: 65 72 73 69 6f 6e 20 3c 62 3e 34 2e 33 2e 30 3c ersion <b>4.3.0<
0100: 2f 62 3e 20 53 70 61 74 69 61 4c 69 74 65 20 73 /b> SpatiaLite s
0110: 75 70 70 6f 72 74 73 20 73 65 76 65 72 61 6c 20 upports several
0120: 6e 65 77 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e new SQL function
0130: 73 20 62 61 73 65 64 20 6f 6e 20 3c 61 20 68 72 s based on <a hr
0140: 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e 77 69 ef="http://en.wi
0150: 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 6b 69 kipedia.org/wiki
0160: 2f 41 66 66 69 6e 65 5f 74 72 61 6e 73 66 6f 72 /Affine_transfor
0170: 6d 61 74 69 6f 6e 22 3e 61 66 66 69 6e 65 20 74 mation">affine t
0180: 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 3c 2f ransformations</
0190: 61 3e 2c 3c 62 72 3e 0d 0a 55 6e 64 65 72 73 74 a>,<br>..Underst
01a0: 61 6e 64 69 6e 67 20 61 6e 64 20 6d 61 73 74 65 anding and maste
01b0: 72 69 6e 67 20 61 6c 6c 20 74 68 65 20 75 6e 64 ring all the und
01c0: 65 72 6c 61 79 69 6e 67 20 6d 61 74 68 65 6d 61 erlaying mathema
01d0: 74 69 63 73 20 63 6f 75 6c 64 20 65 61 73 69 6c tics could easil
01e0: 79 20 62 65 20 61 20 72 61 74 68 65 72 20 64 69 y be a rather di
01f0: 66 66 69 63 75 6c 74 20 74 61 73 6b 2c 20 6d 6f fficult task, mo
0200: 72 65 20 6e 6f 74 61 62 6c 79 20 69 66 20 79 6f re notably if yo
0210: 75 20 68 61 76 65 20 61 62 73 6f 6c 75 74 65 6c u have absolutel
0220: 79 20 6e 6f 20 66 61 6d 69 6c 69 61 72 69 74 79 y no familiarity
0230: 20 77 69 74 68 20 74 68 69 73 20 6b 69 6e 64 20 with this kind
0240: 6f 66 20 6f 70 65 72 61 74 69 6f 6e 73 2e 3c 62 of operations.<b
0250: 72 3e 0d 0a 53 6f 20 77 65 27 6c 6c 20 73 74 61 r>..So we'll sta
0260: 72 74 20 73 6c 6f 77 6c 79 20 61 6e 64 20 73 6d rt slowly and sm
0270: 6f 6f 74 68 6c 79 20 62 79 20 69 6e 74 72 6f 64 oothly by introd
0280: 75 63 69 6e 67 20 66 69 72 73 74 20 61 20 76 65 ucing first a ve
0290: 72 79 20 73 69 6d 70 6c 65 20 70 72 61 63 74 69 ry simple practi
02a0: 63 61 6c 20 65 78 61 6d 70 6c 65 20 62 61 73 65 cal example base
02b0: 64 20 6f 6e 20 6b 69 6e 64 20 6f 66 20 61 20 6a d on kind of a j
02c0: 6f 6b 65 20 61 62 6f 75 74 20 74 68 65 20 67 65 oke about the ge
02d0: 6f 67 72 61 70 68 79 20 6f 66 20 49 74 61 6c 79 ography of Italy
02e0: 20 61 6e 64 20 53 69 63 69 6c 79 2e 0d 0a 3c 68 and Sicily...<h
02f0: 32 3e 46 61 6e 63 79 20 47 65 6f 67 72 61 70 68 2>Fancy Geograph
0300: 79 20 61 6e 64 20 61 6d 75 73 69 6e 67 20 4d 61 y and amusing Ma
0310: 74 68 3c 2f 68 32 3e 0d 0a 3c 74 61 62 6c 65 20 th</h2>..<table
0320: 62 6f 72 64 65 72 3d 22 31 22 20 63 65 6c 6c 73 border="1" cells
0330: 70 61 63 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 pacing="4" cellp
0340: 61 64 64 69 6e 67 3d 22 38 22 3e 0d 0a 3c 74 72 adding="8">..<tr
0350: 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 50 72 65 70 61 ><td>..<h3>Prepa
0360: 72 69 6e 67 20 74 6f 20 73 74 61 72 74 3c 2f 68 ring to start</h
0370: 33 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 64 6f 3>..<ol>..<li>do
0380: 77 6e 6c 6f 61 64 20 74 68 65 20 3c 61 20 68 72 wnload the <a hr
0390: 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 2e ef="https://www.
03a0: 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 61 gaia-gis.it/gaia
03b0: 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d 70 69 63 -sins/affine-pic
03c0: 73 2f 69 74 61 6c 79 2e 7a 69 70 22 3e 73 61 6d s/italy.zip">sam
03d0: 70 6c 65 20 64 61 74 61 73 65 74 3c 2f 61 3e 3c ple dataset</a><
03e0: 62 72 3e 0d 0a 28 69 74 20 73 69 6d 70 6c 79 20 br>..(it simply
03f0: 63 6f 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 corresponds to a
0400: 20 73 6c 69 67 68 74 6c 79 20 72 65 2d 61 64 61 slightly re-ada
0410: 70 74 65 64 20 76 65 63 74 6f 72 20 6d 61 70 20 pted vector map
0420: 6f 66 20 49 74 61 6c 79 27 73 20 52 65 67 69 6f of Italy's Regio
0430: 6e 73 20 61 73 20 6f 72 69 67 69 6e 61 6c 6c 79 ns as originally
0440: 20 72 65 6c 65 61 73 65 64 20 62 79 20 3c 61 20 released by <a
0450: 68 72 65 66 3f 22 68 74 74 70 3a 2f 2f 77 77 77 href?"http://www
0460: 2e 69 73 74 61 74 2e 69 74 2f 69 74 2f 61 72 63 .istat.it/it/arc
0470: 68 69 76 69 6f 2f 31 30 34 33 31 37 22 3e 49 53 hivio/104317">IS
0480: 54 41 54 3c 2f 61 3e 20 75 6e 64 65 72 20 43 43 TAT</a> under CC
0490: 2d 42 59 20 6c 69 63 65 6e 73 65 20 74 65 72 6d -BY license term
04a0: 73 29 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 69 s).</li>..<li><i
04b0: 3e 75 6e 7a 69 70 3c 2f 69 3e 20 74 68 65 20 64 >unzip</i> the d
04c0: 6f 77 6e 6c 6f 61 64 65 64 20 64 61 74 61 73 65 ownloaded datase
04d0: 74 20 61 6e 64 20 69 6d 70 6f 72 74 20 74 68 65 t and import the
04e0: 20 53 68 61 70 65 66 69 6c 65 20 69 6e 74 6f 20 Shapefile into
04f0: 61 20 53 70 61 74 69 61 4c 69 74 65 20 44 42 20 a SpatiaLite DB
0500: 66 69 6c 65 2e 0d 0a 54 68 65 20 61 70 70 72 6f file...The appro
0510: 70 72 69 61 74 65 20 69 6d 70 6f 72 74 20 73 65 priate import se
0520: 74 74 69 6e 67 73 20 61 72 65 20 73 68 6f 77 6e ttings are shown
0530: 20 69 6e 20 74 68 65 20 73 69 64 65 20 66 69 67 in the side fig
0540: 75 72 65 3a 3c 62 72 3e 0d 0a 3c 69 3e 53 52 49 ure:<br>..<i>SRI
0550: 44 3c 2f 69 3e 3d 3c 62 3e 33 32 36 33 32 3c 2f D</i>=<b>32632</
0560: 62 3e 2c 20 3c 69 3e 63 68 61 72 73 65 74 3c 2f b>, <i>charset</
0570: 69 3e 3d 3c 62 3e 43 50 31 32 35 32 3c 2f 62 3e i>=<b>CP1252</b>
0580: 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 45 78 74 72 .</li>..<li>Extr
0590: 61 63 74 20 53 69 63 69 6c 79 20 69 6e 20 61 20 act Sicily in a
05a0: 73 65 6c 66 20 73 74 61 6e 64 69 6e 67 20 44 42 self standing DB
05b0: 20 74 61 62 6c 65 20 62 79 20 65 78 65 63 75 74 table by execut
05c0: 69 6e 67 20 74 68 65 20 66 6f 6c 6c 6f 77 69 6e ing the followin
05d0: 67 20 53 51 4c 20 73 74 61 74 65 6d 65 6e 74 73 g SQL statements
05e0: 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d 0a 43 :..<verbatim>..C
05f0: 52 45 41 54 45 20 54 41 42 4c 45 20 73 69 63 69 REATE TABLE sici
0600: 6c 69 61 20 41 53 0d 0a 53 45 4c 45 43 54 20 2a lia AS..SELECT *
0610: 20 46 52 4f 4d 20 69 74 61 6c 79 20 57 48 45 52 FROM italy WHER
0620: 45 20 63 6f 64 5f 72 65 67 20 3d 20 31 39 3b 0d E cod_reg = 19;.
0630: 0a 0d 0a 53 45 4c 45 43 54 20 52 65 63 6f 76 65 ...SELECT Recove
0640: 72 47 65 6f 6d 65 74 72 79 43 6f 6c 75 6d 6e 28 rGeometryColumn(
0650: 27 73 69 63 69 6c 69 61 27 2c 20 27 67 65 6f 6d 'sicilia', 'geom
0660: 65 74 72 79 27 2c 20 33 32 36 33 32 2c 20 27 4d etry', 32632, 'M
0670: 55 4c 54 49 50 4f 4c 59 47 4f 4e 27 2c 20 27 58 ULTIPOLYGON', 'X
0680: 59 27 29 3b 0d 0a 0d 0a 44 45 4c 45 54 45 20 46 Y');....DELETE F
0690: 52 4f 4d 20 69 74 61 6c 79 20 57 48 45 52 45 20 ROM italy WHERE
06a0: 63 6f 64 5f 72 65 67 20 3d 20 31 39 3b 0d 0a 3c cod_reg = 19;..<
06b0: 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 3c 2f 6c 69 /verbatim>..</li
06c0: 3e 0d 0a 3c 6c 69 3e 74 68 61 74 27 73 20 61 6c >..<li>that's al
06d0: 6c 3a 20 79 6f 75 20 61 72 65 20 6e 6f 77 20 72 l: you are now r
06e0: 65 61 64 79 20 74 6f 20 73 74 61 72 74 20 74 68 eady to start th
06f0: 69 73 20 66 75 6e 6e 79 20 28 61 6e 64 20 6e 6f is funny (and no
0700: 74 20 74 6f 6f 20 6d 75 63 68 20 73 65 72 69 6f t too much serio
0710: 75 73 29 20 74 75 74 6f 72 69 61 6c 20 61 62 6f us) tutorial abo
0720: 75 74 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 ut Affine Transf
0730: 6f 72 6d 61 74 69 6f 6e 73 2e 3c 2f 6c 69 3e 0d ormations.</li>.
0740: 0a 3c 2f 6f 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 .</ol>..</td><td
0750: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 >..<img src="htt
0760: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
0770: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 61 s.it/gaia-sins/a
0780: 66 66 69 6e 65 2d 70 69 63 73 2f 6c 6f 61 64 2d ffine-pics/load-
0790: 73 68 70 2e 70 6e 67 22 20 61 6c 74 3d 22 6c 6f shp.png" alt="lo
07a0: 61 64 2d 73 68 70 22 20 62 6f 72 64 65 72 3d 22 ad-shp" border="
07b0: 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 1">..</td></tr>.
07c0: 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 50 .<tr><td>..<h3>P
07d0: 72 65 66 61 63 65 3c 2f 68 33 3e 0d 0a 4c 6f 6f reface</h3>..Loo
07e0: 6b 20 61 74 20 61 20 6d 61 70 20 6f 66 20 49 74 k at a map of It
07f0: 61 6c 79 3b 20 69 74 20 61 70 70 65 61 72 73 20 aly; it appears
0800: 6f 62 76 69 6f 75 73 20 61 74 20 66 69 72 73 74 obvious at first
0810: 20 67 6c 61 6e 63 65 20 74 68 61 74 20 53 69 63 glance that Sic
0820: 69 6c 79 20 69 73 20 6c 6f 63 61 74 65 64 20 69 ily is located i
0830: 6e 20 61 20 76 65 72 79 20 69 6e 63 6f 6e 76 65 n a very inconve
0840: 6e 69 65 6e 74 20 70 6f 73 69 74 69 6f 6e 3a 0d nient position:.
0850: 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 53 69 63 69 6c .<ol>..<li>Sicil
0860: 79 20 69 73 20 70 6c 61 63 65 64 20 74 6f 6f 20 y is placed too
0870: 66 61 72 20 53 6f 75 74 68 20 61 6e 64 20 74 6f far South and to
0880: 6f 20 6d 75 63 68 20 63 6c 6f 73 65 20 74 6f 20 o much close to
0890: 4e 6f 72 74 68 20 41 66 72 69 63 61 3b 20 74 68 North Africa; th
08a0: 69 73 20 69 6d 70 6c 69 65 73 20 61 6e 20 75 6e is implies an un
08b0: 70 6c 65 61 73 61 6e 74 20 74 6f 72 72 69 64 20 pleasant torrid
08c0: 73 75 6d 6d 65 72 2c 20 61 6e 64 20 74 68 69 73 summer, and this
08d0: 20 6c 61 74 65 72 20 70 6f 73 65 73 20 69 6e 20 later poses in
08e0: 74 75 72 6e 20 6d 61 6e 79 20 73 65 76 65 72 65 turn many severe
08f0: 20 6c 69 6d 69 74 61 74 69 6f 6e 73 20 74 6f 20 limitations to
0900: 61 67 72 69 63 75 6c 74 75 72 61 6c 20 61 63 74 agricultural act
0910: 69 76 69 74 69 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c ivities.</li>..<
0920: 6c 69 3e 54 68 65 20 3c 61 20 68 72 65 66 3d 22 li>The <a href="
0930: 68 74 74 70 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 http://en.wikipe
0940: 64 69 61 2e 6f 72 67 2f 77 69 6b 69 2f 53 74 72 dia.org/wiki/Str
0950: 61 69 74 5f 6f 66 5f 4d 65 73 73 69 6e 61 22 3e ait_of_Messina">
0960: 53 74 72 61 69 74 20 6f 66 20 4d 65 73 73 69 6e Strait of Messin
0970: 61 3c 2f 61 3e 20 69 73 20 65 78 61 67 67 65 72 a</a> is exagger
0980: 61 74 65 64 6c 79 20 6e 61 72 72 6f 77 2c 20 74 atedly narrow, t
0990: 68 75 73 20 70 6f 73 69 6e 67 20 73 65 76 65 72 hus posing sever
09a0: 65 20 73 61 66 65 74 79 20 72 69 73 6b 73 20 20 e safety risks
09b0: 74 6f 20 74 68 65 20 6e 61 76 69 67 61 74 69 6f to the navigatio
09c0: 6e 20 6f 66 20 63 61 70 69 74 61 6c 20 73 68 69 n of capital shi
09d0: 70 73 2c 20 62 69 67 20 63 6f 6e 74 61 69 6e 65 ps, big containe
09e0: 72 20 73 68 69 70 73 2c 20 63 72 75 69 73 65 20 r ships, cruise
09f0: 6c 69 6e 65 72 73 20 61 6e 64 20 73 75 70 65 72 liners and super
0a00: 74 61 6e 6b 65 72 73 2e 3c 62 72 3e 0d 0a 45 76 tankers.<br>..Ev
0a10: 65 6e 20 77 6f 72 73 74 2c 20 66 72 6f 6d 20 74 en worst, from t
0a20: 69 6d 65 20 74 6f 20 74 69 6d 65 20 73 6f 6d 65 ime to time some
0a30: 20 63 72 61 7a 79 20 70 6f 6c 69 74 69 63 69 61 crazy politicia
0a40: 6e 20 73 74 61 72 74 73 20 73 74 72 6f 6e 67 6c n starts strongl
0a50: 79 20 61 64 76 6f 63 61 74 69 6e 67 20 74 68 65 y advocating the
0a60: 20 76 65 72 79 20 73 74 75 70 69 64 20 69 64 65 very stupid ide
0a70: 61 20 74 6f 20 62 75 69 6c 64 20 61 6e 20 69 6e a to build an in
0a80: 63 72 65 64 69 62 6c 79 20 63 6f 73 74 6c 79 20 credibly costly
0a90: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f <a href="http://
0aa0: 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 en.wikipedia.org
0ab0: 2f 77 69 6b 69 2f 53 74 72 61 69 74 5f 6f 66 5f /wiki/Strait_of_
0ac0: 4d 65 73 73 69 6e 61 5f 42 72 69 64 67 65 22 3e Messina_Bridge">
0ad0: 62 72 69 64 67 65 20 63 72 6f 73 73 69 6e 67 20 bridge crossing
0ae0: 74 68 65 20 53 74 72 61 69 74 3c 2f 61 3e 2c 20 the Strait</a>,
0af0: 63 6f 6d 70 6c 65 74 65 6c 79 20 6f 76 65 72 6c completely overl
0b00: 6f 6f 6b 69 6e 67 20 74 68 65 20 76 65 72 79 20 ooking the very
0b10: 68 69 67 68 20 73 65 69 73 6d 69 63 20 72 69 73 high seismic ris
0b20: 6b 20 6f 66 20 74 68 69 73 20 64 69 73 74 72 69 k of this distri
0b30: 63 74 20 61 6e 64 20 70 75 72 70 6f 73 65 6c 79 ct and purposely
0b40: 20 66 6f 72 67 65 74 74 69 6e 67 20 74 6f 20 72 forgetting to r
0b50: 65 6d 65 6d 62 65 72 20 74 68 61 74 20 69 6e 20 emember that in
0b60: 31 39 30 38 20 62 6f 74 68 20 74 6f 77 6e 73 20 1908 both towns
0b70: 6f 66 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 of <a href="http
0b80: 3a 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e ://en.wikipedia.
0b90: 6f 72 67 2f 77 69 6b 69 2f 31 39 30 38 5f 4d 65 org/wiki/1908_Me
0ba0: 73 73 69 6e 61 5f 65 61 72 74 68 71 75 61 6b 65 ssina_earthquake
0bb0: 22 3e 4d 65 73 73 69 6e 61 20 61 6e 64 20 52 65 ">Messina and Re
0bc0: 67 67 69 6f 20 43 61 6c 61 62 72 69 61 3c 2f 61 ggio Calabria</a
0bd0: 3e 20 77 65 72 65 20 63 6f 6d 70 6c 65 74 65 6c > were completel
0be0: 79 20 64 65 73 74 72 6f 79 65 64 20 62 79 20 61 y destroyed by a
0bf0: 6e 20 65 61 72 74 68 71 75 61 6b 65 20 66 6f 6c n earthquake fol
0c00: 6c 6f 77 65 64 20 62 79 20 61 20 74 73 75 6e 61 lowed by a tsuna
0c10: 6d 69 2e 3c 62 72 3e 0d 0a 4d 6f 72 65 20 74 68 mi.<br>..More th
0c20: 61 6e 20 31 32 30 2c 30 30 30 20 70 65 6f 70 6c an 120,000 peopl
0c30: 65 73 20 6c 6f 73 74 20 74 68 65 69 72 20 6c 69 es lost their li
0c40: 76 65 73 2c 20 61 6e 64 20 69 74 20 77 61 73 20 ves, and it was
0c50: 6f 6e 65 20 6f 66 20 74 68 65 20 6d 6f 73 74 20 one of the most
0c60: 66 72 69 67 68 74 65 6e 69 6e 67 20 6e 61 74 75 frightening natu
0c70: 72 61 6c 20 64 69 73 61 73 74 65 72 73 20 72 65 ral disasters re
0c80: 67 69 73 74 65 72 65 64 20 69 6e 20 45 75 72 6f gistered in Euro
0c90: 70 65 20 64 75 72 69 6e 67 20 6d 6f 64 65 72 6e pe during modern
0ca0: 20 74 69 6d 65 73 2e 3c 2f 6c 69 3e 0d 0a 3c 2f times.</li>..</
0cb0: 6f 6c 3e 0d 0a 53 6f 20 77 65 27 6c 6c 20 69 6d ol>..So we'll im
0cc0: 6d 65 64 69 61 74 65 6c 79 20 73 74 61 72 74 20 mediately start
0cd0: 61 20 74 68 65 6f 72 65 74 69 63 61 6c 20 63 61 a theoretical ca
0ce0: 73 65 20 73 74 75 64 79 20 69 6e 74 65 6e 64 65 se study intende
0cf0: 64 20 74 6f 20 69 64 65 6e 74 69 66 79 20 61 20 d to identify a
0d00: 70 6f 73 73 69 62 6c 65 20 61 6c 74 65 72 6e 61 possible alterna
0d10: 74 69 76 65 20 6c 6f 63 61 74 69 6f 6e 20 66 6f tive location fo
0d20: 72 20 53 69 63 69 6c 79 2e 3c 62 72 3e 0d 0a 49 r Sicily.<br>..I
0d30: 6e 63 69 64 65 6e 74 61 6c 6c 79 20 77 65 27 6c ncidentally we'l
0d40: 6c 20 75 73 65 20 74 68 65 20 6e 65 77 20 53 51 l use the new SQ
0d50: 4c 20 66 75 6e 63 74 69 6f 6e 73 20 62 61 73 65 L functions base
0d60: 64 20 6f 6e 20 41 66 66 69 6e 65 20 54 72 61 6e d on Affine Tran
0d70: 73 66 6f 72 6d 61 74 69 6f 6e 73 20 66 6f 72 20 sformations for
0d80: 74 68 69 73 20 74 61 73 6b 2e 3c 62 72 3e 0d 0a this task.<br>..
0d90: 4c 65 74 27 73 20 67 6f 20 6f 6e 2e 20 20 0d 0a Let's go on. ..
0da0: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 </td><td>..<img
0db0: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 src="https://www
0dc0: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 .gaia-gis.it/gai
0dd0: 61 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d 70 69 a-sins/affine-pi
0de0: 63 73 2f 73 69 63 69 6c 79 5f 30 2e 70 6e 67 22 cs/sicily_0.png"
0df0: 20 61 6c 74 3d 22 73 69 63 69 6c 79 2d 30 22 20 alt="sicily-0"
0e00: 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c 2f 74 border="1">..</t
0e10: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
0e20: 3e 0d 0a 3c 68 33 3e 53 74 65 70 20 23 31 3a 20 >..<h3>Step #1:
0e30: 74 72 61 6e 73 6c 61 74 69 6e 67 20 53 69 63 69 translating Sici
0e40: 6c 79 20 69 6e 74 6f 20 61 20 6d 6f 72 65 20 63 ly into a more c
0e50: 6f 6e 76 65 6e 69 65 6e 74 20 70 6f 73 69 74 69 onvenient positi
0e60: 6f 6e 3c 2f 68 33 3e 0d 0a 54 68 65 72 65 20 69 on</h3>..There i
0e70: 73 20 70 6c 65 6e 74 79 20 6f 66 20 66 72 65 65 s plenty of free
0e80: 20 72 6f 6f 6d 20 69 6e 20 74 68 65 20 4c 6f 77 room in the Low
0e90: 65 72 20 54 79 72 72 68 65 6e 69 61 6e 20 53 65 er Tyrrhenian Se
0ea0: 61 2c 20 73 6f 20 77 65 27 6c 6c 20 73 74 61 72 a, so we'll star
0eb0: 74 20 62 79 20 61 70 70 6c 79 69 6e 67 20 61 20 t by applying a
0ec0: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f <a href="http://
0ed0: 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 en.wikipedia.org
0ee0: 2f 77 69 6b 69 2f 54 72 61 6e 73 6c 61 74 69 6f /wiki/Translatio
0ef0: 6e 5f 25 32 38 67 65 6f 6d 65 74 72 79 25 32 39 n_%28geometry%29
0f00: 22 3e 74 72 61 6e 73 6c 61 74 69 6f 6e 3c 2f 61 ">translation</a
0f10: 3e 20 74 6f 20 53 69 63 69 6c 79 3a 20 74 68 69 > to Sicily: thi
0f20: 73 20 70 72 61 63 74 69 63 61 6c 6c 79 20 6d 65 s practically me
0f30: 61 6e 73 20 61 64 64 69 6e 67 20 28 6f 72 20 73 ans adding (or s
0f40: 75 62 74 72 61 63 74 69 6e 67 29 20 61 20 63 6f ubtracting) a co
0f50: 6e 73 74 61 6e 74 20 76 61 6c 75 65 20 74 6f 20 nstant value to
0f60: 74 68 65 20 63 6f 6f 72 64 69 6e 61 74 65 73 20 the coordinates
0f70: 6f 6e 20 62 6f 74 68 20 3c 62 3e 78 3c 2f 62 3e on both <b>x</b>
0f80: 20 61 6e 64 20 3c 62 3e 79 3c 2f 62 3e 20 61 78 and <b>y</b> ax
0f90: 65 73 2e 3c 62 72 3e 0d 0a 41 66 74 65 72 20 61 es.<br>..After a
0fa0: 20 76 65 72 79 20 71 75 69 63 6b 20 65 78 61 6d very quick exam
0fb0: 69 6e 61 74 69 6f 6e 20 6d 6f 76 69 6e 67 20 53 ination moving S
0fc0: 69 63 69 6c 79 20 3c 62 3e 31 35 30 20 6b 6d 3c icily <b>150 km<
0fd0: 2f 62 3e 20 28 69 2e 65 2e 20 3c 62 3e 31 35 30 /b> (i.e. <b>150
0fe0: 2c 30 30 30 20 6d 3c 2f 62 3e 29 20 77 65 73 74 ,000 m</b>) west
0ff0: 77 61 72 64 20 61 6e 64 20 3c 62 3e 31 35 30 20 ward and <b>150
1000: 6b 6d 3c 2f 62 3e 20 6e 6f 72 74 68 77 61 72 64 km</b> northward
1010: 20 73 65 65 6d 73 20 74 6f 20 62 65 20 61 6e 20 seems to be an
1020: 61 62 73 6f 6c 75 74 65 6c 79 20 72 65 61 73 6f absolutely reaso
1030: 6e 61 62 6c 65 20 63 68 6f 69 63 65 2e 3c 62 72 nable choice.<br
1040: 3e 0d 0a 53 6f 20 75 73 69 6e 67 20 74 68 65 20 >..So using the
1050: 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d Affine Transform
1060: 61 74 69 6f 6e 20 53 51 4c 20 66 75 6e 63 74 69 ation SQL functi
1070: 6f 6e 73 20 77 65 27 6c 6c 20 64 75 6c 79 20 65 ons we'll duly e
1080: 78 65 63 75 74 65 20 74 68 65 20 66 6f 6c 6c 6f xecute the follo
1090: 77 69 6e 67 20 53 51 4c 20 73 74 61 74 65 6d 65 wing SQL stateme
10a0: 6e 74 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e 0d nt:..<verbatim>.
10b0: 0a 43 52 45 41 54 45 20 54 41 42 4c 45 20 73 69 .CREATE TABLE si
10c0: 63 69 6c 69 61 5f 31 20 41 53 0d 0a 53 45 4c 45 cilia_1 AS..SELE
10d0: 43 54 20 63 6f 64 5f 72 65 67 2c 20 0d 0a 20 20 CT cod_reg, ..
10e0: 20 41 54 4d 5f 54 72 61 6e 73 66 6f 72 6d 28 67 ATM_Transform(g
10f0: 65 6f 6d 65 74 72 79 2c 0d 0a 20 20 20 20 20 20 eometry,..
1100: 41 54 4d 5f 43 72 65 61 74 65 54 72 61 6e 73 6c ATM_CreateTransl
1110: 61 74 65 28 2d 31 35 30 30 30 30 2c 20 31 35 30 ate(-150000, 150
1120: 30 30 30 29 29 20 41 53 20 67 65 6f 6d 0d 0a 46 000)) AS geom..F
1130: 52 4f 4d 20 73 69 63 69 6c 69 61 5f 30 3b 0d 0a ROM sicilia_0;..
1140: 53 45 4c 45 43 54 20 52 65 63 6f 76 65 72 47 65 SELECT RecoverGe
1150: 6f 6d 65 74 72 79 43 6f 6c 75 6d 6e 28 27 73 69 ometryColumn('si
1160: 63 69 6c 69 61 5f 31 27 2c 20 27 67 65 6f 6d 27 cilia_1', 'geom'
1170: 2c 20 33 32 36 33 32 2c 20 27 4d 55 4c 54 49 50 , 32632, 'MULTIP
1180: 4f 4c 59 47 4f 4e 27 2c 20 27 58 59 27 29 3b 0d OLYGON', 'XY');.
1190: 0a 3c 2f 76 65 72 62 61 74 69 6d 3e 20 0d 0a 3c .</verbatim> ..<
11a0: 62 3e 52 65 6d 61 72 6b 73 3c 2f 62 3e 3a 0d 0a b>Remarks</b>:..
11b0: 3c 75 6c 3e 0d 0a 3c 6c 69 3e 61 6c 6c 20 61 66 <ul>..<li>all af
11c0: 66 69 6e 65 20 74 72 61 6e 73 66 6f 72 6d 61 74 fine transformat
11d0: 69 6f 6e 20 72 65 6c 61 74 65 64 20 53 51 4c 20 ion related SQL
11e0: 66 75 6e 63 74 69 6f 6e 20 6e 61 6d 65 73 20 73 function names s
11f0: 74 61 72 74 20 77 69 74 68 20 61 6e 20 3c 62 3e tart with an <b>
1200: 41 54 4d 5f 3c 2f 62 3e 20 70 72 65 66 69 78 3a ATM_</b> prefix:
1210: 20 74 68 69 73 20 73 69 6d 70 6c 79 20 73 74 61 this simply sta
1220: 6e 64 73 20 66 6f 72 20 3c 69 3e 3c 62 3e 3c 75 nds for <i><b><u
1230: 3e 41 3c 2f 75 3e 3c 2f 62 3e 66 66 69 6e 65 20 >A</u></b>ffine
1240: 3c 62 3e 3c 75 3e 54 3c 2f 75 3e 3c 2f 62 3e 72 <b><u>T</u></b>r
1250: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 3c 62 3e ansformation <b>
1260: 3c 75 3e 4d 3c 2f 75 3e 3c 2f 62 3e 61 74 72 69 <u>M</u></b>atri
1270: 78 3c 2f 69 3e 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 x</i>.</li>..<li
1280: 3e 3c 62 3e 41 54 4d 5f 54 72 61 6e 73 66 6f 72 ><b>ATM_Transfor
1290: 6d 28 29 3c 2f 62 3e 20 69 73 20 76 65 72 79 20 m()</b> is very
12a0: 73 69 6d 69 6c 61 72 20 74 6f 20 3c 62 3e 53 54 similar to <b>ST
12b0: 5f 54 72 61 6e 73 66 6f 72 6d 28 29 3c 2f 62 3e _Transform()</b>
12c0: 3b 20 74 68 65 20 6d 6f 73 74 20 6f 62 76 69 6f ; the most obvio
12d0: 75 73 20 64 69 66 66 65 72 65 6e 63 65 20 69 73 us difference is
12e0: 20 69 6e 20 74 68 61 74 20 61 6c 6c 20 74 72 61 in that all tra
12f0: 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 61 72 67 75 nsformation argu
1300: 6d 65 6e 74 73 20 61 72 65 20 6e 6f 77 20 65 78 ments are now ex
1310: 70 65 63 74 65 64 20 74 6f 20 62 65 20 70 61 73 pected to be pas
1320: 73 65 64 20 75 6e 64 65 72 20 74 68 65 20 66 6f sed under the fo
1330: 72 6d 20 6f 66 20 61 6e 20 61 70 70 72 6f 70 72 rm of an appropr
1340: 69 61 74 65 20 3c 62 3e 42 4c 4f 42 2d 73 65 72 iate <b>BLOB-ser
1350: 69 61 6c 69 7a 65 64 3c 2f 62 3e 20 41 66 66 69 ialized</b> Affi
1360: 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f ne Transformatio
1370: 6e 20 4d 61 74 72 69 78 2e 3c 2f 6c 69 3e 0d 0a n Matrix.</li>..
1380: 3c 6c 69 3e 3c 62 3e 41 54 4d 5f 43 72 65 61 74 <li><b>ATM_Creat
1390: 65 54 72 61 6e 73 6c 61 74 65 28 29 3c 2f 62 3e eTranslate()</b>
13a0: 20 73 69 6d 70 6c 79 20 69 73 20 61 6e 20 53 51 simply is an SQ
13b0: 4c 20 66 75 6e 63 74 69 6f 6e 20 72 65 74 75 72 L function retur
13c0: 6e 69 6e 67 20 61 20 3c 62 3e 42 4c 4f 42 2d 73 ning a <b>BLOB-s
13d0: 65 72 69 61 6c 69 7a 65 64 3c 2f 62 3e 20 41 66 erialized</b> Af
13e0: 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 fine Transformat
13f0: 69 6f 6e 20 4d 61 74 72 69 78 20 69 6e 69 74 69 ion Matrix initi
1400: 61 6c 69 7a 65 64 20 69 6e 20 73 75 63 68 20 61 alized in such a
1410: 20 77 61 79 20 74 6f 20 72 65 70 72 65 73 65 6e way to represen
1420: 74 20 61 20 73 69 6d 70 6c 65 20 3c 62 3e 32 44 t a simple <b>2D
1430: 20 54 72 61 6e 73 6c 61 74 65 3c 2f 62 3e 20 61 Translate</b> a
1440: 63 63 6f 72 64 69 6e 67 6c 79 20 74 6f 20 3c 62 ccordingly to <b
1450: 3e 28 74 78 2c 20 74 79 29 3c 2f 62 3e 20 61 72 >(tx, ty)</b> ar
1460: 67 75 6d 65 6e 74 73 2e 3c 62 72 3e 0d 0a 59 6f guments.<br>..Yo
1470: 75 20 63 6f 75 6c 64 20 65 76 65 6e 74 75 61 6c u could eventual
1480: 6c 79 20 64 65 66 69 6e 65 20 61 20 63 6f 6d 70 ly define a comp
1490: 6c 65 74 65 20 3c 62 3e 33 44 20 54 72 61 6e 73 lete <b>3D Trans
14a0: 6c 61 74 65 3c 2f 62 3e 20 62 79 20 70 61 73 73 late</b> by pass
14b0: 69 6e 67 20 3c 62 3e 28 74 78 2c 20 74 79 2c 20 ing <b>(tx, ty,
14c0: 74 7a 29 3c 2f 62 3e 20 61 72 67 75 6d 65 6e 74 tz)</b> argument
14d0: 73 2c 20 62 75 74 20 74 68 69 73 20 69 73 6e 27 s, but this isn'
14e0: 74 20 73 74 72 69 63 74 6c 79 20 72 65 71 75 69 t strictly requi
14f0: 72 65 64 20 69 6e 20 6f 75 72 20 63 75 72 72 65 red in our curre
1500: 6e 74 20 65 78 61 6d 70 6c 65 2e 0d 0a 3c 2f 75 nt example...</u
1510: 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c l>..</td><td>..<
1520: 69 6d 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f img src="https:/
1530: 2f 77 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 /www.gaia-gis.it
1540: 2f 67 61 69 61 2d 73 69 6e 73 2f 61 66 66 69 6e /gaia-sins/affin
1550: 65 2d 70 69 63 73 2f 73 69 63 69 6c 79 5f 31 2e e-pics/sicily_1.
1560: 70 6e 67 22 20 61 6c 74 3d 22 73 69 63 69 6c 69 png" alt="sicili
1570: 61 2d 31 22 20 62 6f 72 64 65 72 3d 22 31 22 3e a-1" border="1">
1580: 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 ..</td></tr>..<t
1590: 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e 53 74 65 70 r><td>..<h3>Step
15a0: 20 23 32 3a 20 72 6f 74 61 74 69 6e 67 20 53 69 #2: rotating Si
15b0: 63 69 6c 79 20 73 6f 20 74 6f 20 67 65 74 20 61 cily so to get a
15c0: 20 6e 69 63 65 20 68 6f 72 69 7a 6f 6e 74 61 6c nice horizontal
15d0: 20 61 6c 69 67 6e 6d 65 6e 74 3c 2f 68 33 3e 0d alignment</h3>.
15e0: 0a 41 6c 69 67 6e 69 6e 67 20 74 68 65 20 73 6f .Aligning the so
15f0: 75 74 68 65 72 6e 20 73 68 6f 72 65 73 20 6f 66 uthern shores of
1600: 20 53 69 63 69 6c 79 20 74 6f 20 61 6e 20 61 6c Sicily to an al
1610: 6d 6f 73 74 20 68 6f 72 69 7a 6f 6e 74 61 6c 20 most horizontal
1620: 6c 69 6e 65 20 77 69 6c 6c 20 73 75 72 65 6c 79 line will surely
1630: 20 6c 65 61 64 20 74 6f 20 61 20 6d 6f 72 65 20 lead to a more
1640: 6e 69 63 65 6c 79 20 6f 72 64 65 72 65 64 20 6c nicely ordered l
1650: 61 79 6f 75 74 3a 20 73 6f 20 77 65 20 68 61 76 ayout: so we hav
1660: 65 20 6e 6f 77 20 74 6f 20 61 70 70 6c 79 20 61 e now to apply a
1670: 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f <a href="http:/
1680: 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 /en.wikipedia.or
1690: 67 2f 77 69 6b 69 2f 52 6f 74 61 74 69 6f 6e 5f g/wiki/Rotation_
16a0: 25 32 38 6d 61 74 68 65 6d 61 74 69 63 73 25 32 %28mathematics%2
16b0: 39 22 3e 63 6f 75 6e 74 65 72 63 6c 6f 63 6b 77 9">counterclockw
16c0: 69 73 65 20 72 6f 74 61 74 69 6f 6e 3c 2f 61 3e ise rotation</a>
16d0: 20 6f 66 20 61 62 6f 75 74 20 3c 62 3e 32 35 2e of about <b>25.
16e0: 30 20 64 65 67 72 65 65 73 3c 2f 62 3e 2e 3c 62 0 degrees</b>.<b
16f0: 72 3e 0d 0a 54 68 61 6e 6b 73 20 74 6f 20 41 66 r>..Thanks to Af
1700: 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 fine Transformat
1710: 69 6f 6e 73 2c 20 77 65 20 63 61 6e 20 63 6f 6d ions, we can com
1720: 62 69 6e 65 20 62 6f 74 68 20 74 68 65 20 70 72 bine both the pr
1730: 65 76 69 6f 75 73 20 74 72 61 6e 73 6c 61 74 69 evious translati
1740: 6f 6e 20 61 6e 64 20 74 68 65 20 63 75 72 72 65 on and the curre
1750: 6e 74 20 72 6f 74 61 74 69 6f 6e 20 69 6e 74 6f nt rotation into
1760: 20 61 20 73 69 6e 67 6c 65 20 6d 6f 76 65 6d 65 a single moveme
1770: 6e 74 20 28 61 20 73 6f 20 63 61 6c 6c 65 64 20 nt (a so called
1780: 3c 62 3e 72 6f 74 6f 74 72 61 6e 73 6c 61 74 69 <b>rototranslati
1790: 6f 6e 3c 2f 62 3e 29 2e 3c 62 72 3e 0d 0a 57 65 on</b>).<br>..We
17a0: 20 73 69 6d 70 6c 79 20 68 61 76 65 20 74 6f 20 simply have to
17b0: 65 78 65 63 75 74 65 20 74 68 65 20 66 6f 6c 6c execute the foll
17c0: 6f 77 69 6e 67 20 53 51 4c 20 73 74 61 74 65 6d owing SQL statem
17d0: 65 6e 74 3a 0d 0a 3c 76 65 72 62 61 74 69 6d 3e ent:..<verbatim>
17e0: 43 52 45 41 54 45 20 54 41 42 4c 45 20 73 69 63 CREATE TABLE sic
17f0: 69 6c 69 61 5f 32 20 41 53 0d 0a 53 45 4c 45 43 ilia_2 AS..SELEC
1800: 54 20 63 6f 64 5f 72 65 67 2c 20 0d 0a 20 20 20 T cod_reg, ..
1810: 41 54 4d 5f 54 72 61 6e 73 66 6f 72 6d 28 67 65 ATM_Transform(ge
1820: 6f 6d 65 74 72 79 2c 0d 0a 20 20 20 20 20 20 41 ometry,.. A
1830: 54 4d 5f 54 72 61 6e 73 6c 61 74 65 28 2d 31 35 TM_Translate(-15
1840: 30 30 30 30 2c 20 31 35 30 30 30 30 2c 0d 0a 20 0000, 150000,..
1850: 20 20 20 20 20 20 20 20 41 54 4d 5f 54 72 61 6e ATM_Tran
1860: 73 6c 61 74 65 28 63 78 2c 20 63 79 2c 0d 0a 20 slate(cx, cy,..
1870: 20 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f 52 ATM_R
1880: 6f 74 61 74 65 28 32 35 2c 0d 0a 20 20 20 20 20 otate(25,..
1890: 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f 43 72 ATM_Cr
18a0: 65 61 74 65 54 72 61 6e 73 6c 61 74 65 28 2d 63 eateTranslate(-c
18b0: 78 2c 20 2d 63 79 29 29 29 29 29 20 41 53 20 67 x, -cy))))) AS g
18c0: 65 6f 6d 0d 0a 46 52 4f 4d 20 28 53 45 4c 45 43 eom..FROM (SELEC
18d0: 54 20 63 6f 64 5f 72 65 67 2c 20 53 54 5f 58 28 T cod_reg, ST_X(
18e0: 63 65 6e 74 72 6f 69 64 29 20 41 53 20 63 78 2c centroid) AS cx,
18f0: 20 53 54 5f 59 28 63 65 6e 74 72 6f 69 64 29 20 ST_Y(centroid)
1900: 41 53 20 63 79 2c 20 67 65 6f 6d 65 74 72 79 0d AS cy, geometry.
1910: 0a 20 20 20 20 20 20 46 52 4f 4d 20 28 53 45 4c . FROM (SEL
1920: 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 53 54 5f ECT cod_reg, ST_
1930: 43 65 6e 74 72 6f 69 64 28 67 65 6f 6d 65 74 72 Centroid(geometr
1940: 79 29 20 41 53 20 63 65 6e 74 72 6f 69 64 2c 20 y) AS centroid,
1950: 67 65 6f 6d 65 74 72 79 20 0d 0a 20 20 20 20 20 geometry ..
1960: 20 20 20 20 20 20 20 46 52 4f 4d 20 73 69 63 69 FROM sici
1970: 6c 69 61 5f 30 29 20 41 53 20 67 31 0d 0a 29 20 lia_0) AS g1..)
1980: 41 53 20 67 32 3b 0d 0a 53 45 4c 45 43 54 20 52 AS g2;..SELECT R
1990: 65 63 6f 76 65 72 47 65 6f 6d 65 74 72 79 43 6f ecoverGeometryCo
19a0: 6c 75 6d 6e 28 27 73 69 63 69 6c 69 61 5f 32 27 lumn('sicilia_2'
19b0: 2c 20 27 67 65 6f 6d 27 2c 20 33 32 36 33 32 2c , 'geom', 32632,
19c0: 20 27 4d 55 4c 54 49 50 4f 4c 59 47 4f 4e 27 2c 'MULTIPOLYGON',
19d0: 20 27 58 59 27 29 3b 0d 0a 3c 2f 76 65 72 62 61 'XY');..</verba
19e0: 74 69 6d 3e 20 20 0d 0a 3c 62 3e 52 65 6d 61 72 tim> ..<b>Remar
19f0: 6b 73 3c 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c ks</b>:..<ul>..<
1a00: 6c 69 3e 63 6f 72 72 65 63 74 6c 79 20 68 61 6e li>correctly han
1a10: 64 6c 69 6e 67 20 52 6f 74 61 74 65 20 69 73 20 dling Rotate is
1a20: 61 20 6c 69 74 74 6c 65 20 62 69 74 20 6d 6f 72 a little bit mor
1a30: 65 20 64 69 66 66 69 63 75 6c 74 2e 0d 0a 41 6e e difficult...An
1a40: 79 20 72 6f 74 61 74 69 6f 6e 20 77 69 6c 6c 20 y rotation will
1a50: 61 6c 77 61 79 73 20 69 6d 70 6c 79 20 61 20 3c always imply a <
1a60: 62 3e 66 69 78 65 64 20 63 65 6e 74 65 72 20 70 b>fixed center p
1a70: 6f 69 6e 74 3c 2f 62 3e 2c 20 61 6e 64 20 62 79 oint</b>, and by
1a80: 20 64 65 66 61 75 6c 74 20 74 68 69 73 20 69 73 default this is
1a90: 20 65 78 61 63 74 6c 79 20 70 6c 61 63 65 64 20 exactly placed
1aa0: 61 74 20 74 68 65 20 63 6f 6f 72 64 69 6e 61 74 at the coordinat
1ab0: 65 73 20 6f 72 69 67 69 6e 3a 20 3c 62 3e 28 30 es origin: <b>(0
1ac0: 2c 20 30 29 3c 2f 62 3e 2e 3c 2f 6c 69 3e 0d 0a , 0)</b>.</li>..
1ad0: 3c 6c 69 3e 73 6f 20 61 20 76 65 72 79 20 6e 61 <li>so a very na
1ae0: 69 76 65 20 61 74 74 65 6d 70 74 20 74 6f 20 64 ive attempt to d
1af0: 69 72 65 63 74 6c 79 20 69 6e 76 6f 6b 65 20 3c irectly invoke <
1b00: 62 3e 41 54 4d 5f 52 6f 74 61 74 65 28 32 35 29 b>ATM_Rotate(25)
1b10: 3c 2f 62 3e 20 77 69 6c 6c 20 73 69 6d 70 6c 79 </b> will simply
1b20: 20 72 65 6c 6f 63 61 74 65 20 53 69 63 69 6c 79 relocate Sicily
1b30: 20 69 6e 20 53 6f 75 74 68 65 72 6e 20 53 70 61 in Southern Spa
1b40: 69 6e 2c 20 61 6e 64 20 74 68 69 73 20 61 62 73 in, and this abs
1b50: 6f 6c 75 74 65 6c 79 20 69 73 6e 27 74 20 6f 75 olutely isn't ou
1b60: 72 20 69 6e 74 65 6e 74 69 6f 6e 2e 3c 2f 6c 69 r intention.</li
1b70: 3e 0d 0a 3c 6c 69 3e 77 68 61 74 20 77 65 20 72 >..<li>what we r
1b80: 65 61 6c 6c 79 20 6e 65 65 64 20 69 73 20 61 20 eally need is a
1b90: 6d 6f 72 65 20 63 6f 6d 70 6c 65 78 20 73 65 71 more complex seq
1ba0: 75 65 6e 63 65 20 6f 66 20 63 68 61 69 6e 65 64 uence of chained
1bb0: 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 transformations
1bc0: 3a 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 77 65 27 :..<ol>..<li>we'
1bd0: 6c 6c 20 73 74 61 72 74 20 66 69 72 73 74 20 62 ll start first b
1be0: 79 20 63 72 65 61 74 69 6e 67 20 61 20 6e 65 77 y creating a new
1bf0: 20 3c 62 3e 42 4c 4f 42 2d 4d 61 74 72 69 78 3c <b>BLOB-Matrix<
1c00: 2f 62 3e 20 69 6e 74 65 6e 64 65 64 20 74 6f 20 /b> intended to
1c10: 72 65 6c 6f 63 61 74 65 20 53 69 63 69 6c 79 27 relocate Sicily'
1c20: 73 20 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a s <a href="http:
1c30: 2f 2f 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f //en.wikipedia.o
1c40: 72 67 2f 77 69 6b 69 2f 43 65 6e 74 72 6f 69 64 rg/wiki/Centroid
1c50: 22 3e 63 65 6e 74 72 6f 69 64 3c 2f 61 3e 20 65 ">centroid</a> e
1c60: 78 61 63 74 6c 79 20 6f 6e 20 74 68 65 20 63 6f xactly on the co
1c70: 6f 72 64 69 6e 61 74 65 73 20 6f 72 69 67 69 6e ordinates origin
1c80: 3a 20 3c 62 3e 41 54 4d 5f 43 72 65 61 74 65 54 : <b>ATM_CreateT
1c90: 72 61 6e 73 6c 61 74 65 28 2d 63 78 2c 20 2d 63 ranslate(-cx, -c
1ca0: 79 29 3c 2f 62 3e 3c 2f 6c 69 3e 20 0d 0a 3c 6c y)</b></li> ..<l
1cb0: 69 3e 6e 6f 77 20 77 65 20 63 61 6e 20 73 61 66 i>now we can saf
1cc0: 65 6c 79 20 63 68 61 69 6e 20 74 68 65 20 69 6e ely chain the in
1cd0: 74 65 6e 64 65 64 20 52 6f 74 61 74 65 3a 20 3c tended Rotate: <
1ce0: 62 3e 41 54 4d 5f 52 6f 74 61 74 65 28 32 35 2c b>ATM_Rotate(25,
1cf0: 20 61 74 6d 2d 62 6c 6f 62 29 3c 2f 62 3e 3c 2f atm-blob)</b></
1d00: 6c 69 3e 0d 0a 3c 6c 69 3e 61 66 74 65 72 20 61 li>..<li>after a
1d10: 70 70 6c 79 69 6e 67 20 52 6f 74 61 74 65 20 77 pplying Rotate w
1d20: 65 20 68 61 76 65 20 6e 6f 77 20 74 6f 20 72 65 e have now to re
1d30: 73 74 6f 72 65 20 74 68 65 20 69 6e 69 74 69 61 store the initia
1d40: 6c 20 70 6f 73 69 74 69 6f 6e 3a 20 3c 62 3e 41 l position: <b>A
1d50: 54 4d 5f 54 72 61 6e 73 6c 61 74 65 28 63 78 2c TM_Translate(cx,
1d60: 20 63 79 2c 20 61 74 6d 2d 62 6c 6f 62 29 3c 2f cy, atm-blob)</
1d70: 62 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 61 6e 64 b></li>..<li>and
1d80: 20 66 69 6e 61 6c 6c 79 20 77 65 27 6c 6c 20 61 finally we'll a
1d90: 70 70 6c 79 20 74 68 65 20 54 72 61 6e 73 6c 61 pply the Transla
1da0: 74 69 6f 6e 20 69 6e 74 65 6e 64 65 64 20 74 6f tion intended to
1db0: 20 72 65 70 6f 73 69 74 69 6f 6e 20 53 69 63 69 reposition Sici
1dc0: 6c 79 20 77 65 73 74 77 61 72 64 20 61 6e 64 20 ly westward and
1dd0: 6e 6f 72 74 68 77 61 72 64 3a 20 3c 62 3e 41 54 northward: <b>AT
1de0: 4d 5f 54 72 61 6e 73 6c 61 74 65 28 2d 31 35 30 M_Translate(-150
1df0: 30 30 30 2c 20 31 35 30 30 30 30 2c 20 61 74 6d 000, 150000, atm
1e00: 2d 62 6c 6f 62 29 3c 2f 62 3e 3c 62 72 3e 0d 0a -blob)</b><br>..
1e10: 3c 69 3e 77 65 27 76 65 20 75 73 65 64 20 74 77 <i>we've used tw
1e20: 6f 20 73 65 70 61 72 61 74 65 20 74 72 61 6e 73 o separate trans
1e30: 6c 61 74 69 6f 6e 73 20 73 69 6d 70 6c 79 20 66 lations simply f
1e40: 6f 72 20 64 69 64 61 63 74 69 63 20 63 6c 61 72 or didactic clar
1e50: 69 74 79 3a 20 77 65 20 63 6f 75 6c 64 20 65 61 ity: we could ea
1e60: 73 69 6c 79 20 6d 65 72 67 65 20 62 6f 74 68 20 sily merge both
1e70: 74 68 65 6d 20 69 6e 74 6f 20 61 20 73 69 6e 67 them into a sing
1e80: 6c 65 20 74 72 61 6e 73 6c 61 74 69 6f 6e 3a 3c le translation:<
1e90: 62 72 3e 20 41 54 4d 5f 54 72 61 6e 73 6c 61 74 br> ATM_Translat
1ea0: 65 28 63 78 20 2d 20 31 35 30 30 30 30 2c 20 63 e(cx - 150000, c
1eb0: 79 20 2b 20 31 35 30 30 30 30 2c 20 61 74 6d 2d y + 150000, atm-
1ec0: 62 6c 6f 62 29 3c 2f 69 3e 3c 2f 6c 69 3e 0d 0a blob)</i></li>..
1ed0: 3c 6c 69 3e 74 68 69 73 20 77 61 79 20 3c 62 3e <li>this way <b>
1ee0: 41 54 4d 5f 54 72 61 6e 73 66 6f 72 6d 28 29 3c ATM_Transform()<
1ef0: 2f 62 3e 20 77 69 6c 6c 20 72 65 63 65 69 76 65 /b> will receive
1f00: 20 74 68 65 20 66 69 6e 61 6c 20 3c 62 3e 42 4c the final <b>BL
1f10: 4f 42 2d 4d 61 74 72 69 78 3c 2f 62 3e 20 72 65 OB-Matrix</b> re
1f20: 73 75 6c 74 69 6e 67 20 62 79 20 63 68 61 69 6e sulting by chain
1f30: 69 6e 67 20 61 6c 6c 20 74 68 65 20 61 62 6f 76 ing all the abov
1f40: 65 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e e transformation
1f50: 20 73 74 65 70 73 20 69 6e 20 74 68 65 20 63 6f steps in the co
1f60: 72 72 65 63 74 20 73 65 71 75 65 6e 63 65 2e 3c rrect sequence.<
1f70: 2f 6c 69 3e 0d 0a 3c 2f 6f 6c 3e 3c 2f 6c 69 3e /li>..</ol></li>
1f80: 0d 0a 3c 6c 69 3e 3c 62 3e 3c 75 3e 56 65 72 79 ..<li><b><u>Very
1f90: 20 69 6d 70 6f 72 74 61 6e 74 20 6e 6f 74 69 63 important notic
1fa0: 65 3c 2f 75 3e 3c 2f 62 3e 3a 20 41 66 66 69 6e e</u></b>: Affin
1fb0: 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e e Transformation
1fc0: 73 20 3c 75 3e 61 72 65 20 6e 6f 74 20 63 6f 6d s <u>are not com
1fd0: 6d 75 74 61 74 69 76 65 3c 2f 75 3e 3a 20 74 68 mutative</u>: th
1fe0: 65 20 72 65 6c 61 74 69 76 65 20 6f 72 64 65 72 e relative order
1ff0: 20 6f 66 20 73 75 62 73 65 71 75 65 6e 74 20 6f of subsequent o
2000: 70 65 72 61 74 69 6f 6e 73 20 69 6e 20 61 20 63 perations in a c
2010: 6f 6d 70 6c 65 78 20 74 72 61 6e 73 66 6f 72 6d omplex transform
2020: 61 74 69 6f 6e 20 63 68 61 69 6e 20 73 68 6f 75 ation chain shou
2030: 6c 64 20 61 6c 77 61 79 73 20 62 65 20 76 65 72 ld always be ver
2040: 79 20 63 61 72 65 66 75 6c 6c 79 20 63 6f 6e 73 y carefully cons
2050: 69 64 65 72 65 64 2e 3c 2f 6c 69 3e 0d 0a 3c 6c idered.</li>..<l
2060: 69 3e 61 6c 6c 20 74 68 65 20 3c 62 3e 46 52 4f i>all the <b>FRO
2070: 4d 20 28 53 45 4c 45 43 54 20 2e 2e 2e 20 46 52 M (SELECT ... FR
2080: 4f 4d 20 28 53 45 4c 45 43 54 20 2e 2e 2e 29 20 OM (SELECT ...)
2090: 41 53 20 67 31 29 20 41 53 20 67 32 3c 2f 62 3e AS g1) AS g2</b>
20a0: 20 73 74 75 66 66 20 73 69 6d 70 6c 79 20 69 73 stuff simply is
20b0: 20 61 20 72 61 74 68 65 72 20 74 72 69 76 69 61 a rather trivia
20c0: 6c 20 53 51 4c 20 74 72 69 63 6b 20 62 61 73 65 l SQL trick base
20d0: 64 20 6f 6e 20 74 77 6f 20 6e 65 73 74 65 64 20 d on two nested
20e0: 73 75 62 2d 71 75 65 72 69 65 73 2e 3c 62 72 3e sub-queries.<br>
20f0: 0d 0a 69 74 27 73 20 69 6e 64 65 6e 74 65 64 20 ..it's indented
2100: 73 63 6f 70 65 20 73 69 6d 70 6c 79 20 69 73 20 scope simply is
2110: 61 76 6f 69 64 69 6e 67 20 74 6f 20 63 61 6c 6c avoiding to call
2120: 20 74 6f 6f 20 6d 61 6e 79 20 74 69 6d 65 73 20 too many times
2130: 53 54 5f 43 65 6e 74 72 6f 69 64 28 29 2c 20 53 ST_Centroid(), S
2140: 54 5f 58 28 29 20 61 6e 64 20 53 54 5f 59 28 29 T_X() and ST_Y()
2150: 20 69 6e 20 6f 72 64 65 72 20 74 6f 20 67 65 74 in order to get
2160: 20 74 68 65 20 63 65 6e 74 72 6f 69 64 20 63 6f the centroid co
2170: 6f 72 64 69 6e 61 74 65 73 2e 3c 2f 6c 69 3e 0d ordinates.</li>.
2180: 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 .</ul>..</td><td
2190: 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 74 74 >..<img src="htt
21a0: 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d 67 69 ps://www.gaia-gi
21b0: 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 2f 61 s.it/gaia-sins/a
21c0: 66 66 69 6e 65 2d 70 69 63 73 2f 73 69 63 69 6c ffine-pics/sicil
21d0: 79 5f 32 2e 70 6e 67 22 20 61 6c 74 3d 22 73 69 y_2.png" alt="si
21e0: 63 69 6c 69 61 2d 32 22 20 62 6f 72 64 65 72 3d cilia-2" border=
21f0: 22 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e "1">..</td></tr>
2200: 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 33 3e ..<tr><td>..<h3>
2210: 53 74 65 70 20 23 33 3a 20 69 6e 66 6c 61 74 69 Step #3: inflati
2220: 6e 67 20 61 6e 64 20 72 65 73 68 61 70 69 6e 67 ng and reshaping
2230: 20 53 69 63 69 6c 79 3c 2f 68 33 3e 0d 0a 41 6e Sicily</h3>..An
2240: 20 69 6e 63 72 65 61 73 65 64 20 73 75 72 66 61 increased surfa
2250: 63 65 20 69 73 20 73 75 72 65 6c 79 20 77 65 6c ce is surely wel
2260: 63 6f 6d 65 2c 20 62 65 63 61 75 73 65 20 69 74 come, because it
2270: 20 61 75 74 6f 6d 61 74 69 63 61 6c 6c 79 20 69 automatically i
2280: 6d 70 6c 69 65 73 20 6d 6f 72 65 20 61 67 72 69 mplies more agri
2290: 63 75 6c 74 75 72 61 6c 20 6c 61 6e 64 73 3a 20 cultural lands:
22a0: 6f 6e 20 74 68 65 20 6f 74 68 65 72 20 68 61 6e on the other han
22b0: 64 20 73 68 6f 72 74 65 6e 69 6e 67 20 61 20 6c d shortening a l
22c0: 69 74 74 6c 65 20 62 69 74 20 74 68 65 20 6c 65 ittle bit the le
22d0: 6e 67 74 68 20 6f 66 20 74 68 65 20 73 6f 75 74 ngth of the sout
22e0: 68 65 72 6e 20 63 6f 61 73 74 6c 69 6e 65 20 77 hern coastline w
22f0: 69 6c 6c 20 73 75 72 65 6c 79 20 66 61 63 69 6c ill surely facil
2300: 69 74 61 74 65 20 6d 6f 62 69 6c 69 74 79 20 61 itate mobility a
2310: 6e 64 20 63 6f 6d 6d 75 6e 69 63 61 74 69 6f 6e nd communication
2320: 73 2e 3c 62 72 3e 0d 0a 53 6f 20 77 65 27 6c 6c s.<br>..So we'll
2330: 20 6e 6f 77 20 61 70 70 6c 79 20 61 20 3c 61 20 now apply a <a
2340: 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e 2e href="http://en.
2350: 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 69 wikipedia.org/wi
2360: 6b 69 2f 53 63 61 6c 69 6e 67 5f 25 32 38 67 65 ki/Scaling_%28ge
2370: 6f 6d 65 74 72 79 25 32 39 22 3e 73 63 61 6c 69 ometry%29">scali
2380: 6e 67 3c 2f 61 3e 20 74 72 61 6e 73 66 6f 72 6d ng</a> transform
2390: 61 74 69 6f 6e 20 75 73 69 6e 67 20 74 77 6f 20 ation using two
23a0: 64 69 66 66 65 72 65 6e 74 20 76 61 6c 75 65 73 different values
23b0: 3a 20 3c 62 3e 73 78 3d 30 2e 39 3c 2f 62 3e 20 : <b>sx=0.9</b>
23c0: 61 6e 64 20 3c 62 3e 73 79 3d 31 2e 33 3c 2f 62 and <b>sy=1.3</b
23d0: 3e 2e 3c 62 72 3e 0d 0a 4f 6e 63 65 20 61 67 61 >.<br>..Once aga
23e0: 69 6e 2c 20 41 66 66 69 6e 65 20 54 72 61 6e 73 in, Affine Trans
23f0: 66 6f 72 6d 61 74 69 6f 6e 73 20 65 6e 61 62 6c formations enabl
2400: 65 20 75 73 20 74 6f 20 63 6f 6d 62 69 6e 65 20 e us to combine
2410: 61 6c 74 6f 67 65 74 68 65 72 20 62 6f 74 68 20 altogether both
2420: 74 72 61 6e 73 6c 61 74 65 2c 20 72 6f 74 61 74 translate, rotat
2430: 65 20 61 6e 64 20 73 63 61 6c 65 20 69 6e 74 6f e and scale into
2440: 20 61 20 73 69 6e 67 6c 65 20 74 72 61 6e 73 66 a single transf
2450: 6f 72 6d 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 ormation.<br>..T
2460: 68 69 73 20 69 73 20 74 68 65 20 63 6f 72 72 65 his is the corre
2470: 73 70 6f 6e 64 69 6e 67 20 53 51 4c 20 73 74 61 sponding SQL sta
2480: 74 65 6d 65 6e 74 3a 0d 0a 3c 76 65 72 62 61 74 tement:..<verbat
2490: 69 6d 3e 0d 0a 43 52 45 41 54 45 20 54 41 42 4c im>..CREATE TABL
24a0: 45 20 73 69 63 69 6c 69 61 5f 33 20 41 53 0d 0a E sicilia_3 AS..
24b0: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
24c0: 0d 0a 20 20 20 41 54 4d 5f 54 72 61 6e 73 66 6f .. ATM_Transfo
24d0: 72 6d 28 67 65 6f 6d 65 74 72 79 2c 0d 0a 20 20 rm(geometry,..
24e0: 20 20 20 20 41 54 4d 5f 54 72 61 6e 73 6c 61 74 ATM_Translat
24f0: 65 28 2d 31 35 30 30 30 30 2c 20 31 35 30 30 30 e(-150000, 15000
2500: 30 2c 0d 0a 20 20 20 20 20 20 20 20 20 41 54 4d 0,.. ATM
2510: 5f 54 72 61 6e 73 6c 61 74 65 28 63 78 2c 20 63 _Translate(cx, c
2520: 79 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 y,..
2530: 41 54 4d 5f 53 63 61 6c 65 28 30 2e 39 2c 20 31 ATM_Scale(0.9, 1
2540: 2e 33 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 .3,..
2550: 20 20 20 20 41 54 4d 5f 52 6f 74 61 74 65 28 32 ATM_Rotate(2
2560: 35 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 5,..
2570: 20 20 20 20 20 20 41 54 4d 5f 43 72 65 61 74 65 ATM_Create
2580: 54 72 61 6e 73 6c 61 74 65 28 2d 63 78 2c 20 2d Translate(-cx, -
2590: 63 79 29 29 29 29 29 29 20 41 53 20 67 65 6f 6d cy)))))) AS geom
25a0: 0d 0a 46 52 4f 4d 20 28 53 45 4c 45 43 54 20 63 ..FROM (SELECT c
25b0: 6f 64 5f 72 65 67 2c 20 53 54 5f 58 28 63 65 6e od_reg, ST_X(cen
25c0: 74 72 6f 69 64 29 20 41 53 20 63 78 2c 20 53 54 troid) AS cx, ST
25d0: 5f 59 28 63 65 6e 74 72 6f 69 64 29 20 41 53 20 _Y(centroid) AS
25e0: 63 79 2c 20 67 65 6f 6d 65 74 72 79 0d 0a 20 20 cy, geometry..
25f0: 20 20 20 20 46 52 4f 4d 20 28 53 45 4c 45 43 54 FROM (SELECT
2600: 20 63 6f 64 5f 72 65 67 2c 20 53 54 5f 43 65 6e cod_reg, ST_Cen
2610: 74 72 6f 69 64 28 67 65 6f 6d 65 74 72 79 29 20 troid(geometry)
2620: 41 53 20 63 65 6e 74 72 6f 69 64 2c 20 67 65 6f AS centroid, geo
2630: 6d 65 74 72 79 20 0d 0a 20 20 20 20 20 20 20 20 metry ..
2640: 20 20 20 20 46 52 4f 4d 20 73 69 63 69 6c 69 61 FROM sicilia
2650: 5f 30 29 20 41 53 20 67 31 0d 0a 29 20 41 53 20 _0) AS g1..) AS
2660: 67 32 3b 0d 0a 53 45 4c 45 43 54 20 52 65 63 6f g2;..SELECT Reco
2670: 76 65 72 47 65 6f 6d 65 74 72 79 43 6f 6c 75 6d verGeometryColum
2680: 6e 28 27 73 69 63 69 6c 69 61 5f 33 27 2c 20 27 n('sicilia_3', '
2690: 67 65 6f 6d 27 2c 20 33 32 36 33 32 2c 20 27 4d geom', 32632, 'M
26a0: 55 4c 54 49 50 4f 4c 59 47 4f 4e 27 2c 20 27 58 ULTIPOLYGON', 'X
26b0: 59 27 29 3b 0d 0a 3c 2f 76 65 72 62 61 74 69 6d Y');..</verbatim
26c0: 3e 20 0d 0a 3c 62 3e 52 65 6d 61 72 6b 73 3c 2f > ..<b>Remarks</
26d0: 62 3e 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e 74 b>:..<ul>..<li>t
26e0: 68 65 72 65 20 69 73 20 6e 6f 74 68 69 6e 67 20 here is nothing
26f0: 72 65 61 6c 6c 79 20 6e 65 77 20 69 6e 20 74 68 really new in th
2700: 69 73 3a 20 77 65 27 6c 6c 20 73 69 6d 70 6c 79 is: we'll simply
2710: 20 63 68 61 69 6e 20 79 65 74 20 61 6e 6f 74 68 chain yet anoth
2720: 65 72 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f er transformatio
2730: 6e 20 69 6e 20 74 68 65 20 61 70 70 72 6f 70 72 n in the appropr
2740: 69 61 74 65 20 73 65 71 75 65 6e 63 65 20 6f 72 iate sequence or
2750: 64 65 72 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c der.</li>..<li><
2760: 62 3e 41 54 4d 5f 53 63 61 6c 65 28 73 78 2c 20 b>ATM_Scale(sx,
2770: 73 79 29 3c 2f 62 3e 20 69 73 20 69 6e 74 65 6e sy)</b> is inten
2780: 64 65 64 20 66 6f 72 20 74 68 65 20 73 69 6d 70 ded for the simp
2790: 6c 65 72 20 3c 62 3e 32 44 3c 2f 62 3e 20 63 61 ler <b>2D</b> ca
27a0: 73 65 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 69 6e se.</li>..<li>in
27b0: 20 74 68 65 20 6d 6f 72 65 20 67 65 6e 65 72 61 the more genera
27c0: 6c 20 3c 62 3e 33 44 3c 2f 62 3e 20 63 61 73 65 l <b>3D</b> case
27d0: 20 79 6f 75 20 63 61 6e 20 69 6e 76 6f 6b 65 20 you can invoke
27e0: 3c 62 3e 41 54 4d 5f 53 63 61 6c 65 28 73 78 2c <b>ATM_Scale(sx,
27f0: 20 73 79 2c 20 73 7a 29 3c 2f 62 3e 3c 2f 6c 69 sy, sz)</b></li
2800: 3e 0d 0a 3c 2f 75 6c 3e 0d 0a 3c 2f 74 64 3e 3c >..</ul>..</td><
2810: 74 64 3e 0d 0a 3c 69 6d 67 20 73 72 63 3d 22 68 td>..<img src="h
2820: 74 74 70 73 3a 2f 2f 77 77 77 2e 67 61 69 61 2d ttps://www.gaia-
2830: 67 69 73 2e 69 74 2f 67 61 69 61 2d 73 69 6e 73 gis.it/gaia-sins
2840: 2f 61 66 66 69 6e 65 2d 70 69 63 73 2f 73 69 63 /affine-pics/sic
2850: 69 6c 79 5f 33 2e 70 6e 67 22 20 61 6c 74 3d 22 ily_3.png" alt="
2860: 73 69 63 69 6c 69 61 2d 33 22 20 62 6f 72 64 65 sicilia-3" borde
2870: 72 3d 22 31 22 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 r="1">..</td></t
2880: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 0d 0a 3c 68 r>..<tr><td>..<h
2890: 33 3e 53 74 65 70 20 23 34 3a 20 66 69 6e 61 6c 3>Step #4: final
28a0: 20 74 6f 75 63 68 3a 20 72 65 66 6c 65 63 74 69 touch: reflecti
28b0: 6e 67 20 53 69 63 69 6c 79 3c 2f 68 33 3e 0d 0a ng Sicily</h3>..
28c0: 41 20 72 65 66 6c 65 63 74 65 64 20 53 69 63 69 A reflected Sici
28d0: 6c 79 20 70 72 65 73 65 6e 74 73 20 6d 61 6e 79 ly presents many
28e0: 20 69 6e 74 65 72 65 73 74 69 6e 67 20 61 64 76 interesting adv
28f0: 61 6e 74 61 67 65 73 3a 20 77 65 27 6c 6c 20 65 antages: we'll e
2900: 78 61 6d 69 6e 65 20 61 6c 6c 20 74 68 65 6d 20 xamine all them
2910: 69 6e 20 66 75 6c 6c 20 64 65 74 61 69 6c 20 69 in full detail i
2920: 6e 20 74 68 65 20 66 69 6e 61 6c 20 63 6f 6e 63 n the final conc
2930: 6c 75 73 69 6f 6e 73 20 6f 66 20 74 68 65 20 70 lusions of the p
2940: 72 65 73 65 6e 74 20 73 74 75 64 79 2e 3c 62 72 resent study.<br
2950: 3e 0d 0a 53 6f 20 77 65 27 6c 6c 20 6e 6f 77 20 >..So we'll now
2960: 61 70 70 6c 79 20 61 20 66 69 6e 61 6c 20 3c 61 apply a final <a
2970: 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f 65 6e href="http://en
2980: 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 2f 77 .wikipedia.org/w
2990: 69 6b 69 2f 52 65 66 6c 65 63 74 69 6f 6e 5f 25 iki/Reflection_%
29a0: 32 38 6d 61 74 68 65 6d 61 74 69 63 73 25 32 39 28mathematics%29
29b0: 22 3e 72 65 66 6c 65 63 74 69 6f 6e 3c 2f 61 3e ">reflection</a>
29c0: 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 3b transformation;
29d0: 20 74 68 69 73 20 73 69 6d 70 6c 79 20 63 6f 72 this simply cor
29e0: 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 20 3c 62 responds to a <b
29f0: 3e 31 38 30 20 64 65 67 72 65 65 73 3c 2f 62 3e >180 degrees</b>
2a00: 20 72 6f 74 61 74 69 6f 6e 20 61 72 6f 75 6e 64 rotation around
2a10: 20 74 68 65 20 3c 62 3e 59 20 61 78 69 73 3c 2f the <b>Y axis</
2a20: 62 3e 2e 3c 62 72 3e 0d 0a 41 6e 64 20 74 68 65 b>.<br>..And the
2a30: 20 66 6f 6c 6c 6f 77 69 6e 67 20 69 73 20 74 68 following is th
2a40: 65 20 66 69 6e 61 6c 20 53 51 4c 20 73 74 61 74 e final SQL stat
2a50: 65 6d 65 6e 74 20 61 70 70 6c 79 69 6e 67 20 61 ement applying a
2a60: 6c 6c 20 74 68 65 20 61 62 6f 76 65 20 74 72 61 ll the above tra
2a70: 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 20 69 6e 20 nsformations in
2a80: 61 20 73 69 6e 67 6c 65 20 73 68 6f 74 3a 0d 0a a single shot:..
2a90: 3c 76 65 72 62 61 74 69 6d 3e 43 52 45 41 54 45 <verbatim>CREATE
2aa0: 20 54 41 42 4c 45 20 73 69 63 69 6c 69 61 5f 32 TABLE sicilia_2
2ab0: 20 41 53 0d 0a 43 52 45 41 54 45 20 54 41 42 4c AS..CREATE TABL
2ac0: 45 20 73 69 63 69 6c 69 61 5f 34 20 41 53 0d 0a E sicilia_4 AS..
2ad0: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
2ae0: 0d 0a 20 20 20 41 54 4d 5f 54 72 61 6e 73 66 6f .. ATM_Transfo
2af0: 72 6d 28 67 65 6f 6d 65 74 72 79 2c 0d 0a 20 20 rm(geometry,..
2b00: 20 20 20 20 41 54 4d 5f 54 72 61 6e 73 6c 61 74 ATM_Translat
2b10: 65 28 2d 31 35 30 30 30 30 2c 20 31 35 30 30 30 e(-150000, 15000
2b20: 30 2c 0d 0a 20 20 20 20 20 20 20 20 20 41 54 4d 0,.. ATM
2b30: 5f 54 72 61 6e 73 6c 61 74 65 28 63 78 2c 20 63 _Translate(cx, c
2b40: 79 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 y,..
2b50: 41 54 4d 5f 59 52 6f 6c 6c 28 31 38 30 2c 0d 0a ATM_YRoll(180,..
2b60: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 41 A
2b70: 54 4d 5f 53 63 61 6c 65 28 30 2e 39 2c 20 31 2e TM_Scale(0.9, 1.
2b80: 33 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 20 20 3,..
2b90: 20 20 20 20 20 20 41 54 4d 5f 52 6f 74 61 74 65 ATM_Rotate
2ba0: 28 32 35 2c 0d 0a 20 20 20 20 20 20 20 20 20 20 (25,..
2bb0: 20 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f 43 ATM_C
2bc0: 72 65 61 74 65 54 72 61 6e 73 6c 61 74 65 28 2d reateTranslate(-
2bd0: 63 78 2c 20 2d 63 79 29 29 29 29 29 29 29 20 41 cx, -cy))))))) A
2be0: 53 20 67 65 6f 6d 0d 0a 46 52 4f 4d 20 28 53 45 S geom..FROM (SE
2bf0: 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 53 54 LECT cod_reg, ST
2c00: 5f 58 28 63 65 6e 74 72 6f 69 64 29 20 41 53 20 _X(centroid) AS
2c10: 63 78 2c 20 53 54 5f 59 28 63 65 6e 74 72 6f 69 cx, ST_Y(centroi
2c20: 64 29 20 41 53 20 63 79 2c 20 67 65 6f 6d 65 74 d) AS cy, geomet
2c30: 72 79 0d 0a 20 20 20 20 20 20 46 52 4f 4d 20 28 ry.. FROM (
2c40: 53 45 4c 45 43 54 20 63 6f 64 5f 72 65 67 2c 20 SELECT cod_reg,
2c50: 53 54 5f 43 65 6e 74 72 6f 69 64 28 67 65 6f 6d ST_Centroid(geom
2c60: 65 74 72 79 29 20 41 53 20 63 65 6e 74 72 6f 69 etry) AS centroi
2c70: 64 2c 20 67 65 6f 6d 65 74 72 79 20 0d 0a 20 20 d, geometry ..
2c80: 20 20 20 20 20 20 20 20 20 20 46 52 4f 4d 20 73 FROM s
2c90: 69 63 69 6c 69 61 5f 30 29 20 41 53 20 67 31 0d icilia_0) AS g1.
2ca0: 0a 29 20 41 53 20 67 32 3b 0d 0a 53 45 4c 45 43 .) AS g2;..SELEC
2cb0: 54 20 52 65 63 6f 76 65 72 47 65 6f 6d 65 74 72 T RecoverGeometr
2cc0: 79 43 6f 6c 75 6d 6e 28 27 73 69 63 69 6c 69 61 yColumn('sicilia
2cd0: 5f 34 27 2c 20 27 67 65 6f 6d 27 2c 20 33 32 36 _4', 'geom', 326
2ce0: 33 32 2c 20 27 4d 55 4c 54 49 50 4f 4c 59 47 4f 32, 'MULTIPOLYGO
2cf0: 4e 27 2c 20 27 58 59 27 29 3b 0d 0a 3c 2f 76 65 N', 'XY');..</ve
2d00: 72 62 61 74 69 6d 3e 20 0d 0a 3c 62 3e 52 65 6d rbatim> ..<b>Rem
2d10: 61 72 6b 73 3c 2f 62 3e 3a 0d 0a 3c 75 6c 3e 0d arks</b>:..<ul>.
2d20: 0a 3c 6c 69 3e 74 68 65 72 65 20 61 72 65 20 73 .<li>there are s
2d30: 65 76 65 72 61 6c 20 70 6f 73 73 69 62 6c 65 20 everal possible
2d40: 72 6f 74 61 74 69 6f 6e 73 20 73 75 70 70 6f 72 rotations suppor
2d50: 74 65 64 20 62 79 20 41 66 66 69 6e 65 20 54 72 ted by Affine Tr
2d60: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 3a 0d 0a 3c ansformation:..<
2d70: 6f 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 41 54 4d 5f ol>..<li><b>ATM_
2d80: 52 6f 74 61 74 65 28 29 3c 2f 62 3e 20 61 6c 77 Rotate()</b> alw
2d90: 61 79 73 20 69 6e 74 65 6e 64 73 20 61 20 3c 62 ays intends a <b
2da0: 3e 32 44 3c 2f 62 3e 20 72 6f 74 61 74 69 6f 6e >2D</b> rotation
2db0: 2c 20 69 2e 65 2e 20 61 20 72 6f 74 61 74 69 6f , i.e. a rotatio
2dc0: 6e 20 63 65 6e 74 65 72 65 64 20 61 72 6f 75 6e n centered aroun
2dd0: 64 20 74 68 65 20 3c 62 3e 5a 20 61 78 69 73 3c d the <b>Z axis<
2de0: 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 49 6e /b></li>..<li>In
2df0: 20 74 68 65 20 6d 6f 72 65 20 67 65 6e 65 72 61 the more genera
2e00: 6c 20 3c 62 3e 33 44 3c 2f 62 3e 20 63 61 73 65 l <b>3D</b> case
2e10: 20 74 68 65 72 65 20 61 72 65 20 74 68 72 65 65 there are three
2e20: 20 70 6f 73 73 69 62 6c 65 20 72 6f 74 61 74 69 possible rotati
2e30: 6f 6e 73 2c 20 6f 6e 65 20 66 6f 72 20 65 61 63 ons, one for eac
2e40: 68 20 61 78 69 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c h axis.</li>..<l
2e50: 69 3e 74 68 65 20 63 6f 72 72 65 73 70 6f 6e 64 i>the correspond
2e60: 69 6e 67 20 53 51 4c 20 66 75 6e 63 74 69 6f 6e ing SQL function
2e70: 73 20 61 72 65 3a 20 3c 62 3e 41 54 4d 5f 58 52 s are: <b>ATM_XR
2e80: 6f 6c 6c 28 61 6e 67 6c 65 29 3c 2f 62 3e 2c 20 oll(angle)</b>,
2e90: 3c 62 3e 41 54 4d 5f 59 52 6f 6c 6c 28 61 6e 67 <b>ATM_YRoll(ang
2ea0: 6c 65 29 3c 2f 62 3e 20 61 6e 64 20 3c 62 3e 41 le)</b> and <b>A
2eb0: 54 4d 5f 5a 52 6f 6c 6c 28 61 6e 67 6c 65 29 3c TM_ZRoll(angle)<
2ec0: 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 69 /b></li>..<li><i
2ed0: 3e 3c 75 3e 4e 6f 74 65 3c 2f 75 3e 3a 20 41 54 ><u>Note</u>: AT
2ee0: 4d 5f 5a 52 6f 6c 6c 28 29 20 61 6e 64 20 41 54 M_ZRoll() and AT
2ef0: 4d 5f 52 6f 74 61 74 65 28 29 20 73 69 6d 70 6c M_Rotate() simpl
2f00: 79 20 61 72 65 20 74 77 6f 20 64 69 66 66 65 72 y are two differ
2f10: 65 6e 74 20 61 6c 69 61 73 2d 6e 61 6d 65 73 20 ent alias-names
2f20: 66 6f 72 20 74 68 65 20 73 61 6d 65 20 69 64 65 for the same ide
2f30: 6e 74 69 63 61 6c 20 53 51 4c 20 66 75 6e 63 74 ntical SQL funct
2f40: 69 6f 6e 3c 2f 69 3e 2e 3c 2f 6c 69 3e 0d 0a 3c ion</i>.</li>..<
2f50: 2f 6f 6c 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c 3e /ol></li>..</ul>
2f60: 0d 0a 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d ..</td><td>..<im
2f70: 67 20 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 g src="https://w
2f80: 77 77 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 ww.gaia-gis.it/g
2f90: 61 69 61 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d aia-sins/affine-
2fa0: 70 69 63 73 2f 73 69 63 69 6c 79 5f 34 2e 70 6e pics/sicily_4.pn
2fb0: 67 22 20 61 6c 74 3d 22 73 69 63 69 6c 69 61 2d g" alt="sicilia-
2fc0: 34 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 4" border="1">..
2fd0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
2fe0: 3c 74 64 3e 0d 0a 3c 68 33 3e 46 69 6e 61 6c 20 <td>..<h3>Final
2ff0: 63 6f 6e 73 69 64 65 72 61 74 69 6f 6e 73 20 61 considerations a
3000: 6e 64 20 63 6f 6e 63 6c 75 73 69 6f 6e 73 3c 2f nd conclusions</
3010: 68 33 3e 0d 0a 3c 6f 6c 3e 0d 0a 3c 6c 69 3e 3c h3>..<ol>..<li><
3020: 62 3e 41 67 72 69 63 75 6c 74 75 72 65 3c 2f 62 b>Agriculture</b
3030: 3e 3a 20 61 66 74 65 72 20 69 74 73 20 72 65 6c >: after its rel
3040: 6f 63 61 74 69 6f 6e 20 53 69 63 69 6c 79 20 77 ocation Sicily w
3050: 69 6c 6c 20 67 61 69 6e 20 6d 75 63 68 20 6d 6f ill gain much mo
3060: 72 65 20 61 67 72 69 63 75 6c 74 75 72 61 6c 20 re agricultural
3070: 6c 61 6e 64 20 61 6e 64 20 77 69 6c 6c 20 65 6e land and will en
3080: 6a 6f 79 20 61 20 6d 6f 72 65 20 66 61 76 6f 75 joy a more favou
3090: 72 61 62 6c 65 20 63 6c 69 6d 61 74 65 3a 20 73 rable climate: s
30a0: 74 69 6c 6c 20 73 75 6e 6e 79 20 61 6e 64 20 77 till sunny and w
30b0: 61 72 6d 20 62 75 74 20 6d 75 63 68 20 6c 65 73 arm but much les
30c0: 73 20 61 72 69 64 2e 3c 62 72 3e 0d 0a 54 68 69 s arid.<br>..Thi
30d0: 73 20 77 69 6c 6c 20 63 65 72 74 61 69 6e 6c 79 s will certainly
30e0: 20 73 75 73 74 61 69 6e 20 61 20 6e 6f 74 69 63 sustain a notic
30f0: 65 61 62 6c 65 20 64 65 76 65 6c 6f 70 6d 65 6e eable developmen
3100: 74 20 6f 66 20 6d 61 6e 79 20 65 63 6f 6e 6f 6d t of many econom
3110: 69 63 20 61 63 74 69 76 69 74 69 65 73 2e 3c 2f ic activities.</
3120: 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 54 72 61 6e li>..<li><b>Tran
3130: 73 70 6f 72 74 61 74 69 6f 6e 20 73 79 73 74 65 sportation syste
3140: 6d 73 3c 2f 62 3e 3a 20 74 68 65 20 73 75 67 67 ms</b>: the sugg
3150: 65 73 74 65 64 20 6e 65 77 20 6c 61 79 6f 75 74 ested new layout
3160: 20 66 6f 72 20 74 68 65 20 4c 6f 77 65 72 20 54 for the Lower T
3170: 79 72 72 68 65 6e 69 61 6e 20 53 65 61 20 73 74 yrrhenian Sea st
3180: 72 6f 6e 67 6c 79 20 66 61 63 69 6c 69 74 61 74 rongly facilitat
3190: 65 73 20 74 68 65 20 64 65 76 65 6c 6f 70 6d 65 es the developme
31a0: 6e 74 20 6f 66 20 6d 61 72 69 74 69 6d 65 20 74 nt of maritime t
31b0: 72 61 6e 73 70 6f 72 74 73 2e 20 53 69 63 69 6c ransports. Sicil
31c0: 79 20 63 6f 75 6c 64 20 6e 6f 77 20 62 65 63 6f y could now beco
31d0: 6d 65 20 74 68 65 20 63 65 6e 74 72 61 6c 20 68 me the central h
31e0: 75 62 20 6f 66 20 61 20 68 69 67 68 6c 79 20 65 ub of a highly e
31f0: 66 66 69 63 69 65 6e 74 20 6e 65 74 77 6f 72 6b fficient network
3200: 20 6f 66 20 68 69 67 68 2d 73 70 65 65 64 20 61 of high-speed a
3210: 6e 64 20 68 69 67 68 2d 66 72 65 71 75 65 6e 63 nd high-frequenc
3220: 79 20 66 65 72 72 79 20 63 6f 6e 6e 65 63 74 69 y ferry connecti
3230: 6f 6e 73 3a 0d 0a 3c 75 6c 3e 0d 0a 3c 6c 69 3e ons:..<ul>..<li>
3240: 50 61 6c 65 72 6d 6f 20 77 69 6c 6c 20 6e 6f 77 Palermo will now
3250: 20 64 69 72 65 63 74 6c 79 20 66 61 63 65 20 4e directly face N
3260: 61 70 6c 65 73 3b 20 43 69 76 69 74 61 76 65 63 aples; Civitavec
3270: 63 68 69 61 20 28 52 6f 6d 65 29 20 73 65 65 6d chia (Rome) seem
3280: 73 20 74 6f 20 62 65 20 61 20 73 65 63 6f 6e 64 s to be a second
3290: 20 6f 62 76 69 6f 75 73 20 74 65 72 6d 69 6e 61 obvious termina
32a0: 6c 20 66 6f 72 20 64 69 72 65 63 74 20 63 6f 6e l for direct con
32b0: 6e 65 63 74 69 6f 6e 73 20 6c 65 61 64 69 6e 67 nections leading
32c0: 20 74 6f 20 43 65 6e 74 72 61 6c 20 49 74 61 6c to Central Ital
32d0: 79 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e 4d 65 73 y.</li>..<li>Mes
32e0: 73 69 6e 61 20 77 69 6c 6c 20 61 63 71 75 69 72 sina will acquir
32f0: 65 20 61 20 64 65 63 69 73 69 76 65 20 73 74 72 e a decisive str
3300: 61 74 65 67 69 63 20 72 6f 6c 65 2c 20 61 6e 64 ategic role, and
3310: 20 77 69 6c 6c 20 62 65 63 6f 6d 65 20 74 68 65 will become the
3320: 20 74 65 72 6d 69 6e 61 6c 20 66 6f 72 20 66 65 terminal for fe
3330: 72 72 79 20 63 6f 6e 6e 65 63 74 69 6f 6e 73 20 rry connections
3340: 6c 65 61 64 69 6e 67 20 74 6f 20 43 65 6e 74 72 leading to Centr
3350: 61 6c 20 61 6e 64 20 4e 6f 72 74 68 65 72 6e 20 al and Northern
3360: 49 74 61 6c 79 3a 20 43 69 76 69 74 61 76 65 63 Italy: Civitavec
3370: 63 68 69 61 2c 20 4c 65 67 68 6f 72 6e 20 61 6e chia, Leghorn an
3380: 64 20 47 65 6e 6f 61 20 61 72 65 20 74 68 65 20 d Genoa are the
3390: 6f 62 76 69 6f 75 73 20 64 65 73 74 69 6e 61 74 obvious destinat
33a0: 69 6f 6e 73 2e 3c 2f 6c 69 3e 0d 0a 3c 6c 69 3e ions.</li>..<li>
33b0: 41 20 6c 65 73 73 20 72 65 6c 65 76 61 6e 74 20 A less relevant
33c0: 28 62 75 74 20 61 6e 79 77 61 79 20 69 6e 74 65 (but anyway inte
33d0: 72 65 73 74 69 6e 67 29 20 66 65 72 72 79 20 6c resting) ferry l
33e0: 69 6e 6b 20 77 69 6c 6c 20 6a 6f 69 6e 20 54 72 ink will join Tr
33f0: 61 70 61 6e 69 20 61 6e 64 20 52 65 67 67 69 6f apani and Reggio
3400: 20 43 61 6c 61 62 72 69 61 2e 3c 2f 6c 69 3e 0d Calabria.</li>.
3410: 0a 3c 6c 69 3e 53 61 72 64 69 6e 69 61 20 77 69 .<li>Sardinia wi
3420: 6c 6c 20 73 74 72 6f 6e 67 6c 79 20 62 65 6e 65 ll strongly bene
3430: 66 69 74 20 66 72 6f 6d 20 74 68 65 20 6e 65 77 fit from the new
3440: 20 6c 61 79 6f 75 74 3b 20 43 61 67 6c 69 61 72 layout; Cagliar
3450: 69 20 77 69 6c 6c 20 62 65 20 64 69 72 65 63 74 i will be direct
3460: 6c 79 20 63 6f 6e 6e 65 63 74 65 64 20 74 6f 20 ly connected to
3470: 53 79 72 61 63 75 73 65 20 28 6f 72 20 6d 61 79 Syracuse (or may
3480: 20 62 65 20 41 75 67 75 73 74 61 29 2c 20 61 6e be Augusta), an
3490: 64 20 4f 6c 62 69 61 20 74 6f 20 4d 65 73 73 69 d Olbia to Messi
34a0: 6e 61 2e 3c 62 72 3e 54 68 69 73 20 6d 65 61 6e na.<br>This mean
34b0: 73 20 64 65 66 69 6e 69 74 65 6c 79 20 62 72 65 s definitely bre
34c0: 61 6b 69 6e 67 20 74 68 65 20 73 65 63 75 6c 61 aking the secula
34d0: 72 20 69 6e 73 75 6c 61 74 69 6f 6e 20 6f 66 20 r insulation of
34e0: 53 61 72 64 69 6e 69 61 2c 20 74 68 61 74 20 77 Sardinia, that w
34f0: 69 6c 6c 20 6e 6f 77 20 73 74 61 72 74 20 65 6e ill now start en
3500: 6a 6f 79 69 6e 67 20 61 20 73 74 72 6f 6e 67 65 joying a stronge
3510: 72 20 61 6e 64 20 6d 6f 72 65 20 65 66 66 65 63 r and more effec
3520: 74 69 76 65 20 69 6e 74 65 67 72 61 74 69 6f 6e tive integration
3530: 20 77 69 74 68 20 53 6f 75 74 68 65 72 6e 20 49 with Southern I
3540: 74 61 6c 79 2e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69 taly.</li> ..<li
3550: 3e 4c 61 73 74 20 62 75 74 20 6e 6f 74 20 6c 65 >Last but not le
3560: 61 73 74 3a 20 61 74 20 61 20 6d 6f 72 65 20 73 ast: at a more s
3570: 74 72 61 74 65 67 69 63 20 6c 65 76 65 6c 20 69 trategic level i
3580: 74 27 73 20 61 62 73 6f 6c 75 74 65 6c 79 20 6f t's absolutely o
3590: 62 76 69 6f 75 73 20 74 68 61 74 20 6e 6f 77 20 bvious that now
35a0: 73 75 70 65 72 74 61 6e 6b 65 72 73 2c 20 62 69 supertankers, bi
35b0: 67 20 63 6f 6e 74 61 69 6e 65 72 20 73 68 69 70 g container ship
35c0: 73 20 61 6e 64 20 63 72 75 69 73 65 20 6c 69 6e s and cruise lin
35d0: 65 72 73 20 63 61 6e 20 66 72 65 65 6c 79 20 63 ers can freely c
35e0: 69 72 63 75 6d 6e 61 76 69 67 61 74 65 20 53 69 ircumnavigate Si
35f0: 63 69 6c 79 20 69 6e 20 61 6e 79 20 64 69 72 65 cily in any dire
3600: 63 74 69 6f 6e 20 75 6e 64 65 72 20 75 6e 63 6f ction under unco
3610: 6d 70 72 6f 6d 69 73 65 64 20 73 61 66 65 74 79 mpromised safety
3620: 20 63 6f 6e 64 69 74 69 6f 6e 73 2e 3c 62 72 3e conditions.<br>
3630: 0d 0a 41 6e 64 20 63 6f 6e 73 65 71 75 65 6e 74 ..And consequent
3640: 6c 79 20 61 6c 6c 20 54 79 72 72 68 65 6e 69 61 ly all Tyrrhenia
3650: 6e 20 68 61 72 62 6f 72 73 20 77 69 6c 6c 20 6e n harbors will n
3660: 6f 77 20 62 65 20 64 69 72 65 63 74 6c 79 20 63 ow be directly c
3670: 6f 6e 6e 65 63 74 65 64 20 62 6f 74 68 20 74 6f onnected both to
3680: 20 45 61 73 74 65 72 6e 20 61 6e 64 20 57 65 73 Eastern and Wes
3690: 74 65 72 6e 20 4d 65 64 69 74 65 72 72 61 6e 65 tern Mediterrane
36a0: 61 6e 3a 20 74 68 69 73 20 77 69 6c 6c 20 73 75 an: this will su
36b0: 72 65 6c 79 20 69 6e 64 75 63 65 20 61 20 72 65 rely induce a re
36c0: 6d 61 72 6b 61 62 6c 65 20 67 72 6f 77 74 68 20 markable growth
36d0: 69 6e 20 74 68 65 20 76 6f 6c 75 6d 65 73 20 6f in the volumes o
36e0: 66 20 69 6e 74 65 72 6e 61 74 69 6f 6e 61 6c 20 f international
36f0: 74 72 61 66 66 69 63 73 20 74 68 65 79 20 63 6f traffics they co
3700: 75 6c 64 20 70 6f 74 65 6e 74 69 61 6c 6c 79 20 uld potentially
3710: 61 74 74 72 61 63 74 2e 3c 2f 6c 69 3e 20 0d 0a attract.</li> ..
3720: 3c 2f 75 6c 3e 3c 2f 6c 69 3e 20 0d 0a 3c 6c 69 </ul></li> ..<li
3730: 3e 3c 62 3e 48 65 61 76 79 20 69 6e 64 75 73 74 ><b>Heavy indust
3740: 72 79 3c 2f 62 3e 3a 20 74 68 65 20 6e 65 77 20 ry</b>: the new
3750: 74 72 61 6e 73 70 6f 72 74 61 74 69 6f 6e 20 73 transportation s
3760: 79 73 74 65 6d 20 73 74 72 6f 6e 67 6c 79 20 63 ystem strongly c
3770: 65 6e 74 65 72 65 64 20 61 72 6f 75 6e 64 20 6d entered around m
3780: 61 72 69 74 69 6d 65 20 63 6f 6d 6d 75 6e 69 63 aritime communic
3790: 61 74 69 6f 6e 73 20 77 69 6c 6c 20 73 75 72 65 ations will sure
37a0: 6c 79 20 69 6e 64 75 63 65 20 61 6e 20 61 63 74 ly induce an act
37b0: 69 76 65 20 72 65 62 69 72 74 68 20 6f 66 20 73 ive rebirth of s
37c0: 68 69 70 79 61 72 64 73 2c 20 61 20 66 6c 6f 75 hipyards, a flou
37d0: 72 69 73 68 69 6e 67 20 74 72 61 64 69 74 69 6f rishing traditio
37e0: 6e 61 6c 20 65 78 63 65 6c 6c 65 6e 63 65 20 6f nal excellence o
37f0: 66 20 6d 61 6e 79 20 73 6f 75 74 68 65 72 6e 20 f many southern
3800: 72 65 67 69 6f 6e 73 20 69 6e 20 70 61 73 74 20 regions in past
3810: 74 69 6d 65 73 20 62 75 74 20 6e 6f 77 61 64 61 times but nowada
3820: 79 73 20 61 20 64 65 63 6c 69 6e 69 6e 67 20 61 ys a declining a
3830: 63 74 69 76 69 74 79 2e 3c 2f 6c 69 3e 0d 0a 3c ctivity.</li>..<
3840: 6c 69 3e 3c 62 3e 54 6f 75 72 69 73 6d 3c 2f 62 li><b>Tourism</b
3850: 3e 3a 20 61 20 72 65 61 72 72 61 6e 67 65 64 20 >: a rearranged
3860: 4c 6f 77 65 72 20 54 79 72 72 68 65 6e 69 61 6e Lower Tyrrhenian
3870: 20 53 65 61 20 77 69 6c 6c 20 63 65 72 74 61 69 Sea will certai
3880: 6e 6c 79 20 70 72 6f 6d 6f 74 65 20 61 20 73 74 nly promote a st
3890: 72 6f 6e 67 20 64 65 76 65 6c 6f 70 6d 65 6e 74 rong development
38a0: 20 6f 66 20 69 6e 74 65 72 6e 61 74 69 6f 6e 61 of internationa
38b0: 6c 20 74 6f 75 72 69 73 6d 2e 3c 62 72 3e 0d 0a l tourism.<br>..
38c0: 49 74 27 73 20 77 6f 72 74 68 20 6e 6f 74 69 6e It's worth notin
38d0: 67 20 74 68 61 74 20 74 68 65 20 70 72 6f 70 6f g that the propo
38e0: 73 65 64 20 6c 61 79 6f 75 74 20 77 69 6c 6c 20 sed layout will
38f0: 67 69 76 65 20 62 69 72 74 68 20 74 6f 20 61 20 give birth to a
3900: 77 6f 6e 64 65 72 66 75 6c 20 69 73 6c 61 6e 64 wonderful island
3910: 20 67 72 6f 75 70 20 65 78 74 65 6e 64 69 6e 67 group extending
3920: 20 62 65 74 77 65 65 6e 20 53 69 63 69 6c 79 20 between Sicily
3930: 61 6e 64 20 73 6f 75 74 68 65 72 6e 20 4c 61 7a and southern Laz
3940: 69 6f 20 2d 20 43 61 6d 70 61 6e 69 61 3b 20 74 io - Campania; t
3950: 68 65 20 50 6f 6e 74 69 6e 65 2c 20 41 65 6f 6c he Pontine, Aeol
3960: 69 61 6e 20 61 6e 64 20 47 75 6c 66 20 6f 66 20 ian and Gulf of
3970: 4e 61 70 6c 65 73 20 69 73 6c 61 6e 64 73 20 77 Naples islands w
3980: 69 6c 6c 20 62 65 20 70 72 61 63 74 69 63 61 6c ill be practical
3990: 6c 79 20 6d 65 72 67 65 64 20 69 6e 74 6f 20 61 ly merged into a
39a0: 20 73 69 6e 67 6c 65 20 61 72 63 68 69 70 65 6c single archipel
39b0: 61 67 6f 2e 3c 62 72 3e 0d 0a 53 65 76 65 72 61 ago.<br>..Severa
39c0: 6c 20 6f 66 20 74 68 65 73 65 20 69 73 6c 61 6e l of these islan
39d0: 64 73 20 61 63 74 75 61 6c 6c 79 20 61 72 65 20 ds actually are
39e0: 61 63 74 69 76 65 20 76 6f 6c 63 61 6e 6f 65 73 active volcanoes
39f0: 2c 20 61 6e 64 20 74 68 65 20 6e 65 77 20 69 73 , and the new is
3a00: 6c 61 6e 64 20 63 68 61 69 6e 20 77 69 6c 6c 20 land chain will
3a10: 64 69 72 65 63 74 6c 79 20 6a 6f 69 6e 20 4d 6f directly join Mo
3a20: 75 6e 74 20 45 74 6e 61 20 61 6e 64 20 4d 6f 75 unt Etna and Mou
3a30: 6e 74 20 56 65 73 75 76 69 75 73 2e 3c 62 72 3e nt Vesuvius.<br>
3a40: 0d 0a 53 6f 20 74 68 69 73 20 61 72 65 61 20 77 ..So this area w
3a50: 69 6c 6c 20 72 65 70 72 65 73 65 6e 74 20 74 68 ill represent th
3a60: 65 20 6d 6f 73 74 20 69 6d 70 72 65 73 73 69 76 e most impressiv
3a70: 65 20 76 6f 6c 63 61 6e 69 63 20 66 69 65 6c 64 e volcanic field
3a80: 20 6f 66 20 45 75 72 6f 70 65 20 61 6e 64 20 77 of Europe and w
3a90: 69 6c 6c 20 63 65 72 74 61 69 6e 6c 79 20 62 65 ill certainly be
3aa0: 63 6f 6d 65 20 61 20 73 74 72 6f 6e 67 20 74 6f come a strong to
3ab0: 75 72 69 73 74 69 63 20 61 74 74 72 61 63 74 69 uristic attracti
3ac0: 6f 6e 20 74 68 61 6e 6b 73 20 74 6f 20 69 74 73 on thanks to its
3ad0: 20 6e 69 63 65 6c 79 20 73 75 6e 6e 79 20 77 65 nicely sunny we
3ae0: 61 74 68 65 72 20 61 6e 64 20 70 6c 65 61 73 61 ather and pleasa
3af0: 6e 74 20 63 6c 69 6d 61 74 65 2e 0d 0a 3c 2f 6c nt climate...</l
3b00: 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 49 6e 74 65 72 i>..<li><b>Inter
3b10: 6e 61 6c 20 63 6f 6d 6d 65 72 63 65 3c 2f 62 3e nal commerce</b>
3b20: 3a 20 77 65 20 63 61 6e 20 65 61 73 69 6c 79 20 : we can easily
3b30: 66 6f 72 65 63 61 73 74 20 61 20 73 74 72 6f 6e forecast a stron
3b40: 67 20 67 72 6f 77 74 68 20 69 6e 20 76 6f 6c 75 g growth in volu
3b50: 6d 65 20 6f 66 20 69 6e 74 65 72 6e 61 6c 20 65 me of internal e
3b60: 78 63 68 61 6e 67 65 73 20 74 68 61 6e 6b 73 20 xchanges thanks
3b70: 74 6f 20 74 68 65 20 62 65 74 74 65 72 20 63 6f to the better co
3b80: 6e 6e 65 63 74 69 76 69 74 79 20 62 61 73 65 64 nnectivity based
3b90: 20 6f 6e 20 6d 61 72 69 74 69 6d 65 20 74 72 61 on maritime tra
3ba0: 6e 73 70 6f 72 74 73 2e 3c 62 72 3e 20 0d 0a 4a nsports.<br> ..J
3bb0: 75 73 74 20 61 20 73 69 6e 67 6c 65 20 65 78 61 ust a single exa
3bc0: 6d 70 6c 65 3a 20 53 61 72 64 69 6e 69 61 20 73 mple: Sardinia s
3bd0: 68 6f 75 6c 64 20 6e 6f 77 20 62 65 20 61 62 6c hould now be abl
3be0: 65 20 74 6f 20 65 78 70 6f 72 74 20 69 74 73 20 e to export its
3bf0: 66 69 6e 65 73 74 20 73 68 65 65 70 20 63 68 65 finest sheep che
3c00: 65 73 65 20 6f 6e 20 43 61 6c 61 62 72 69 61 6e ese on Calabrian
3c10: 20 6d 61 72 6b 65 74 73 20 77 68 69 6c 73 74 20 markets whilst
3c20: 43 61 6c 61 62 72 69 61 20 63 6f 75 6c 64 20 66 Calabria could f
3c30: 72 65 65 6c 79 20 65 78 70 6f 72 74 20 69 74 73 reely export its
3c40: 20 72 65 6e 6f 77 6e 20 72 65 64 20 68 6f 74 20 renown red hot
3c50: 63 68 69 6c 6c 79 20 70 65 70 70 65 72 73 20 74 chilly peppers t
3c60: 6f 20 53 61 72 64 69 6e 69 61 3b 20 6e 6f 74 20 o Sardinia; not
3c70: 6f 6e 6c 79 20 62 6f 74 68 20 72 65 67 69 6f 6e only both region
3c80: 73 20 77 69 6c 6c 20 77 69 64 65 6c 79 20 62 65 s will widely be
3c90: 6e 65 66 69 74 20 66 72 6f 6d 20 69 6e 63 72 65 nefit from incre
3ca0: 61 73 65 64 20 65 78 63 68 61 6e 67 65 20 76 6f ased exchange vo
3cb0: 6c 75 6d 65 73 2c 20 62 75 74 20 53 69 63 69 6c lumes, but Sicil
3cc0: 79 20 61 73 20 77 65 6c 6c 20 77 69 6c 6c 20 74 y as well will t
3cd0: 61 6b 65 20 70 72 6f 66 69 74 20 66 72 6f 6d 20 ake profit from
3ce0: 66 6c 6f 75 72 69 73 68 69 6e 67 20 6c 6f 67 69 flourishing logi
3cf0: 73 74 69 63 20 61 6e 64 20 62 79 20 6f 74 68 65 stic and by othe
3d00: 72 20 61 63 74 69 76 69 74 69 65 73 20 62 61 73 r activities bas
3d10: 65 64 20 6f 6e 20 63 6f 6d 6d 65 72 63 69 61 6c ed on commercial
3d20: 20 69 6e 74 65 72 6d 65 64 69 61 74 69 6f 6e 20 intermediation
3d30: 73 65 72 76 69 63 65 73 2e 3c 2f 6c 69 3e 0d 0a services.</li>..
3d40: 3c 6c 69 3e 3c 62 3e 50 72 61 63 74 69 63 61 6c <li><b>Practical
3d50: 20 72 65 61 6c 69 7a 61 74 69 6f 6e 3c 2f 62 3e realization</b>
3d60: 3a 20 74 68 65 20 70 72 65 73 65 6e 74 20 73 74 : the present st
3d70: 75 64 79 20 63 6c 65 61 72 6c 79 20 64 65 6d 6f udy clearly demo
3d80: 6e 73 74 72 61 74 65 73 20 74 68 61 74 20 74 68 nstrates that th
3d90: 65 72 65 20 69 73 20 6e 6f 74 68 69 6e 67 20 69 ere is nothing i
3da0: 6e 20 4d 61 74 68 65 6d 61 74 69 63 73 2c 20 47 n Mathematics, G
3db0: 65 6f 6d 65 74 72 79 20 6f 72 20 47 65 6f 67 72 eometry or Geogr
3dc0: 61 70 68 79 20 66 6f 72 62 69 64 64 69 6e 67 20 aphy forbidding
3dd0: 74 68 65 20 70 72 61 63 74 69 63 61 6c 20 72 65 the practical re
3de0: 61 6c 69 7a 61 74 69 6f 6e 20 6f 66 20 74 68 65 alization of the
3df0: 20 73 75 67 67 65 73 74 65 64 20 69 64 65 61 2e suggested idea.
3e00: 3c 62 72 3e 0d 0a 55 6e 68 61 70 70 69 6c 79 20 <br>..Unhappily
3e10: 74 68 65 20 63 75 72 72 65 6e 74 20 73 74 61 74 the current stat
3e20: 65 20 6f 66 20 74 68 65 20 61 72 74 20 69 6e 20 e of the art in
3e30: 47 65 6f 6c 6f 67 79 20 73 74 69 6c 6c 20 70 6f Geology still po
3e40: 73 65 73 20 6d 61 6e 79 20 70 75 7a 7a 6c 69 6e ses many puzzlin
3e50: 67 20 70 72 6f 62 6c 65 6d 73 20 6e 6f 74 20 79 g problems not y
3e60: 65 74 20 66 75 6c 6c 79 20 72 65 73 6f 6c 76 65 et fully resolve
3e70: 64 2e 3c 62 72 3e 0d 0a 41 6e 79 77 61 79 20 77 d.<br>..Anyway w
3e80: 65 20 61 72 65 20 68 6f 70 65 66 75 6c 6c 79 20 e are hopefully
3e90: 65 78 70 65 63 74 69 6e 67 20 74 68 61 74 20 66 expecting that f
3ea0: 75 74 75 72 65 20 61 64 76 61 6e 63 65 6d 65 6e uture advancemen
3eb0: 74 73 20 69 6e 20 54 65 63 74 6f 6e 69 63 73 20 ts in Tectonics
3ec0: 77 69 6c 6c 20 70 6f 73 73 69 62 6c 79 20 61 6c will possibly al
3ed0: 6c 6f 77 20 74 6f 20 6f 76 65 72 63 6f 6d 65 20 low to overcome
3ee0: 61 6e 79 20 72 65 6d 61 69 6e 69 6e 67 20 69 73 any remaining is
3ef0: 73 75 65 2e 20 4d 6f 72 65 20 73 70 65 63 69 66 sue. More specif
3f00: 69 63 61 6c 6c 79 20 61 20 62 65 74 74 65 72 20 ically a better
3f10: 6b 6e 6f 77 6c 65 64 67 65 20 6f 66 20 69 6e 74 knowledge of int
3f20: 65 72 61 63 74 69 6f 6e 73 20 62 65 74 77 65 65 eractions betwee
3f30: 6e 20 74 68 65 20 63 72 75 73 74 20 61 6e 64 20 n the crust and
3f40: 74 68 65 20 75 70 70 65 72 20 6d 61 6e 74 6c 65 the upper mantle
3f50: 20 61 6c 6f 6e 67 20 74 68 65 20 4d 6f 68 6f 20 along the Moho
3f60: 61 6e 64 20 61 20 64 65 65 70 65 72 20 63 6f 6d and a deeper com
3f70: 70 72 65 68 65 6e 73 69 6f 6e 20 6f 66 20 74 68 prehension of th
3f80: 65 20 6d 69 63 72 6f 2d 70 6c 61 71 75 65 73 20 e micro-plaques
3f90: 6d 65 63 68 61 6e 69 63 73 20 77 69 6c 6c 20 63 mechanics will c
3fa0: 65 72 74 61 69 6e 6c 79 20 68 65 6c 70 3b 20 77 ertainly help; w
3fb0: 65 20 61 72 65 20 72 61 74 68 65 72 20 63 6f 6e e are rather con
3fc0: 66 69 64 65 6e 74 20 69 6e 20 66 75 74 75 72 65 fident in future
3fd0: 20 72 65 73 65 61 72 63 68 20 61 63 68 69 65 76 research achiev
3fe0: 65 6d 65 6e 74 73 20 6f 6e 20 74 68 65 73 65 20 ements on these
3ff0: 66 69 65 6c 64 73 2e 0d 0a 3c 2f 6f 6c 3e 0d 0a fields...</ol>..
4000: 3c 2f 74 64 3e 3c 74 64 3e 0d 0a 3c 69 6d 67 20 </td><td>..<img
4010: 73 72 63 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 src="https://www
4020: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 67 61 69 .gaia-gis.it/gai
4030: 61 2d 73 69 6e 73 2f 61 66 66 69 6e 65 2d 70 69 a-sins/affine-pi
4040: 63 73 2f 69 74 61 6c 79 2d 32 2e 30 2e 70 6e 67 cs/italy-2.0.png
4050: 22 20 61 6c 74 3d 22 69 74 61 6c 79 2d 32 2e 30 " alt="italy-2.0
4060: 22 20 62 6f 72 64 65 72 3d 22 31 22 3e 0d 0a 3c " border="1">..<
4070: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 /td></tr>..</tab
4080: 6c 65 3e 3c 62 72 3e 3c 68 72 3e 0d 0a 3c 68 32 le><br><hr>..<h2
4090: 3e 42 6f 72 69 6e 67 20 4d 61 74 68 3a 20 61 20 >Boring Math: a
40a0: 6d 6f 72 65 20 66 6f 72 6d 61 6c 20 70 72 65 73 more formal pres
40b0: 65 6e 74 61 74 69 6f 6e 3c 2f 68 32 3e 0d 0a 50 entation</h2>..P
40c0: 6c 61 79 74 69 6d 65 27 73 20 6f 76 65 72 3a 20 laytime's over:
40d0: 77 65 27 6c 6c 20 6e 6f 77 20 73 74 61 72 74 20 we'll now start
40e0: 61 20 6d 6f 73 74 20 73 65 72 69 6f 75 73 20 65 a most serious e
40f0: 78 70 6c 61 6e 61 74 69 6f 6e 2e 3c 62 72 3e 3c xplanation.<br><
4100: 62 72 3e 0d 0a 41 6e 20 41 66 66 69 6e 65 20 54 br>..An Affine T
4110: 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 63 61 ransformation ca
4120: 6e 20 62 65 20 72 65 70 72 65 73 65 6e 74 65 64 n be represented
4130: 20 69 6e 20 74 68 65 20 66 6f 72 6d 20 6f 66 20 in the form of
4140: 61 20 73 71 75 61 72 65 20 6d 61 74 72 69 78 3b a square matrix;
4150: 20 74 68 65 20 73 69 6d 70 6c 65 72 20 3c 62 3e the simpler <b>
4160: 32 44 3c 2f 62 3e 20 63 61 73 65 20 72 65 71 75 2D</b> case requ
4170: 69 72 65 73 20 61 20 3c 62 3e 33 20 78 20 33 3c ires a <b>3 x 3<
4180: 2f 62 3e 20 6d 61 74 72 69 78 2c 20 61 6e 64 20 /b> matrix, and
4190: 74 68 65 20 66 6f 6c 6c 6f 77 69 6e 67 73 20 61 the followings a
41a0: 72 65 20 74 68 65 20 70 6f 73 73 69 62 6c 65 20 re the possible
41b0: 61 72 72 61 6e 67 65 6d 65 6e 74 73 20 63 6f 72 arrangements cor
41c0: 72 65 73 70 6f 6e 64 69 6e 67 20 74 6f 20 65 61 responding to ea
41d0: 63 68 20 65 6c 65 6d 65 6e 74 61 72 79 20 74 72 ch elementary tr
41e0: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 3a 3c 62 72 ansformation:<br
41f0: 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 3e 0d 0a ><br>..<table>..
4200: 3c 74 72 3e 3c 74 64 20 72 6f 77 73 70 61 6e 3d <tr><td rowspan=
4210: 22 34 22 20 76 61 6c 69 67 6e 3d 22 6d 69 64 64 "4" valign="midd
4220: 6c 65 22 3e 47 65 6e 65 72 61 6c 20 6c 61 79 6f le">General layo
4230: 75 74 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f ut</td>..<td>/</
4240: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
4250: 6e 74 65 72 22 3e 3c 62 3e 61 3c 2f 62 3e 3c 2f nter"><b>a</b></
4260: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
4270: 6e 74 65 72 22 3e 3c 62 3e 62 3c 2f 62 3e 3c 2f nter"><b>b</b></
4280: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
4290: 6e 74 65 72 22 3e 3c 62 3e 78 6f 66 66 3c 2f 62 nter"><b>xoff</b
42a0: 3e 3c 2f 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e ></td><td>\</td>
42b0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c </tr>..<tr><td>|
42c0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
42d0: 63 65 6e 74 65 72 22 3e 3c 62 3e 64 3c 2f 62 3e center"><b>d</b>
42e0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
42f0: 63 65 6e 74 65 72 22 3e 3c 62 3e 65 3c 2f 62 3e center"><b>e</b>
4300: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
4310: 63 65 6e 74 65 72 22 3e 3c 62 3e 79 6f 66 66 3c center"><b>yoff<
4320: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 /b></td><td>|</t
4330: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
4340: 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >\</td><td align
4350: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
4360: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
4370: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
4380: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 gn="center">1</t
4390: 64 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 d><td>/</td></tr
43a0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 >..<tr><td colsp
43b0: 61 6e 3d 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 3e an="5"><hr></td>
43c0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 </tr>..<tr><td r
43d0: 6f 77 73 70 61 6e 3d 22 34 22 20 76 61 6c 69 67 owspan="4" valig
43e0: 6e 3d 22 6d 69 64 64 6c 65 22 3e 49 64 65 6e 74 n="middle">Ident
43f0: 69 74 79 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f 3c ity</td>..<td>/<
4400: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
4410: 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 enter">1</td><td
4420: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
4430: 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 0</td><td align=
4440: 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c "center">0</td><
4450: 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a td>\</td></tr>..
4460: 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 <tr><td>|</td><t
4470: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
4480: 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >0</td><td align
4490: 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e ="center">1</td>
44a0: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
44b0: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f r">0</td><td>|</
44c0: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
44d0: 64 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 d>\</td><td alig
44e0: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
44f0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
4500: 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c er">0</td><td al
4510: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f ign="center">1</
4520: 74 64 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 td><td>/</td></t
4530: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 r>..<tr><td cols
4540: 70 61 6e 3d 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 pan="5"><hr></td
4550: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 ></tr>..<tr><td
4560: 72 6f 77 73 70 61 6e 3d 22 34 22 20 76 61 6c 69 rowspan="4" vali
4570: 67 6e 3d 22 6d 69 64 64 6c 65 22 3e 54 72 61 6e gn="middle">Tran
4580: 73 6c 61 74 65 28 3c 62 3e 74 78 3c 2f 62 3e 2c slate(<b>tx</b>,
4590: 20 3c 62 3e 74 79 3c 2f 62 3e 29 26 6e 62 73 70 <b>ty</b>) 
45a0: 3b 26 6e 62 73 70 3b 26 6e 62 73 70 3b 3c 2f 74 ; </t
45b0: 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 74 d>..<td>/</td><t
45c0: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
45d0: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >1</td><td align
45e0: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
45f0: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
4600: 72 22 3e 3c 62 3e 74 78 3c 2f 62 3e 3c 2f 74 64 r"><b>tx</b></td
4610: 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>\</td></tr>
4620: 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e ..<tr><td>|</td>
4630: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
4640: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
4650: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 gn="center">1</t
4660: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
4670: 74 65 72 22 3e 3c 62 3e 74 79 3c 2f 62 3e 3c 2f ter"><b>ty</b></
4680: 74 64 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 td><td>|</td></t
4690: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 5c 3c 2f 74 r>..<tr><td>\</t
46a0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
46b0: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 ter">0</td><td a
46c0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
46d0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
46e0: 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 enter">1</td><td
46f0: 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 >/</td></tr>..<t
4700: 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 35 r><td colspan="5
4710: 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e "><hr></td></tr>
4720: 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f 77 73 70 61 ..<tr><td rowspa
4730: 6e 3d 22 34 22 20 76 61 6c 69 67 6e 3d 22 6d 69 n="4" valign="mi
4740: 64 64 6c 65 22 3e 53 63 61 6c 65 28 3c 62 3e 73 ddle">Scale(<b>s
4750: 78 3c 2f 62 3e 2c 20 3c 62 3e 73 79 3c 2f 62 3e x</b>, <b>sy</b>
4760: 29 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f 74 )</td>..<td>/</t
4770: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
4780: 74 65 72 22 3e 3c 62 3e 73 78 3c 2f 62 3e 3c 2f ter"><b>sx</b></
4790: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
47a0: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 nter">0</td><td
47b0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 align="center">0
47c0: 3c 2f 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c </td><td>\</td><
47d0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c /tr>..<tr><td>|<
47e0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
47f0: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
4800: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
4810: 3c 62 3e 73 79 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 <b>sy</b></td><t
4820: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
4830: 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 64 >0</td><td>|</td
4840: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
4850: 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d \</td><td align=
4860: 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c "center">0</td><
4870: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
4880: 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">0</td><td alig
4890: 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 n="center">1</td
48a0: 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>/</td></tr>
48b0: 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 ..<tr><td colspa
48c0: 6e 3d 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c n="5"><hr></td><
48d0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f /tr>..<tr><td ro
48e0: 77 73 70 61 6e 3d 22 34 22 20 76 61 6c 69 67 6e wspan="4" valign
48f0: 3d 22 6d 69 64 64 6c 65 22 3e 52 6f 74 61 74 65 ="middle">Rotate
4900: 28 3c 62 3e 26 74 68 65 74 61 3b 3c 2f 62 3e 29 (<b>θ</b>)
4910: 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f 74 64 </td>..<td>/</td
4920: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
4930: 65 72 22 3e 3c 62 3e 63 6f 73 28 26 74 68 65 74 er"><b>cos(&thet
4940: 61 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 a;)</b></td><td
4950: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c align="center"><
4960: 62 3e 2d 73 69 6e 28 26 74 68 65 74 61 3b 29 3c b>-sin(θ)<
4970: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 /b></td><td alig
4980: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
4990: 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>\</td></tr>
49a0: 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e ..<tr><td>|</td>
49b0: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
49c0: 72 22 3e 3c 62 3e 73 69 6e 28 26 74 68 65 74 61 r"><b>sin(&theta
49d0: 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 ;)</b></td><td a
49e0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
49f0: 3e 63 6f 73 28 26 74 68 65 74 61 3b 29 3c 2f 62 >cos(θ)</b
4a00: 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d ></td><td align=
4a10: 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c "center">0</td><
4a20: 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a td>|</td></tr>..
4a30: 3c 74 72 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 74 <tr><td>\</td><t
4a40: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
4a50: 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >0</td><td align
4a60: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
4a70: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
4a80: 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 2f 3c 2f r">1</td><td>/</
4a90: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
4aa0: 64 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f d></td></tr>..</
4ab0: 74 61 62 6c 65 3e 3c 62 72 3e 0d 0a 41 20 3c 62 table><br>..A <b
4ac0: 3e 33 44 3c 2f 62 3e 20 61 66 66 69 6e 65 20 74 >3D</b> affine t
4ad0: 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 72 65 ransformation re
4ae0: 71 75 69 72 65 73 20 61 20 3c 62 3e 34 20 78 20 quires a <b>4 x
4af0: 34 3c 2f 62 3e 20 6d 61 74 72 69 78 2e 3c 62 72 4</b> matrix.<br
4b00: 3e 0d 0a 41 73 20 79 6f 75 20 63 61 6e 20 65 61 >..As you can ea
4b10: 73 69 6c 79 20 6e 6f 74 69 63 65 20 74 68 65 72 sily notice ther
4b20: 65 20 69 73 20 61 6e 20 6f 62 76 69 6f 75 73 20 e is an obvious
4b30: 64 69 72 65 63 74 20 72 65 6c 61 74 69 6f 6e 20 direct relation
4b40: 62 65 74 77 65 65 6e 20 61 20 33 44 20 6d 61 74 between a 3D mat
4b50: 72 69 78 20 61 6e 64 20 61 20 32 44 20 6d 61 74 rix and a 2D mat
4b60: 72 69 78 3b 20 6e 6f 74 69 63 65 20 74 68 65 20 rix; notice the
4b70: 63 65 6c 6c 73 20 73 68 6f 77 69 6e 67 20 61 20 cells showing a
4b80: 67 72 61 79 20 62 61 63 6b 67 72 6f 75 6e 64 2e gray background.
4b90: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 74 61 62 6c 65 <br><br>..<table
4ba0: 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f 77 73 70 >..<tr><td rowsp
4bb0: 61 6e 3d 22 35 22 20 76 61 6c 69 67 6e 3d 22 6d an="5" valign="m
4bc0: 69 64 64 6c 65 22 3e 47 65 6e 65 72 61 6c 20 6c iddle">General l
4bd0: 61 79 6f 75 74 26 6e 62 73 70 3b 26 6e 62 73 70 ayout  
4be0: 3b 26 6e 62 73 70 3b 3c 2f 74 64 3e 0d 0a 3c 74 ; </td>..<t
4bf0: 64 3e 2f 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 d>/</td><td alig
4c00: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 61 3c n="center"><b>a<
4c10: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 /b></td><td alig
4c20: 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 62 3c n="center"><b>b<
4c30: 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 /b></td><td alig
4c40: 6e 3d 22 63 65 6e 74 65 72 22 20 62 67 63 6f 6c n="center" bgcol
4c50: 6f 72 3d 22 23 64 30 64 30 64 30 22 3e 3c 62 3e or="#d0d0d0"><b>
4c60: 63 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c c</b></td><td al
4c70: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e ign="center"><b>
4c80: 78 6f 66 66 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 xoff</b></td><td
4c90: 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 >\</td></tr>..<t
4ca0: 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 r><td>|</td><td
4cb0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c align="center"><
4cc0: 62 3e 64 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 b>d</b></td><td
4cd0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c align="center"><
4ce0: 62 3e 65 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 b>e</b></td><td
4cf0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 20 62 align="center" b
4d00: 67 63 6f 6c 6f 72 3d 22 23 64 30 64 30 64 30 22 gcolor="#d0d0d0"
4d10: 3e 3c 62 3e 66 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 ><b>f</b></td><t
4d20: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
4d30: 3e 3c 62 3e 79 6f 66 66 3c 2f 62 3e 3c 2f 74 64 ><b>yoff</b></td
4d40: 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>|</td></tr>
4d50: 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e ..<tr><td>|</td>
4d60: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
4d70: 72 22 20 62 67 63 6f 6c 6f 72 3d 22 23 64 30 64 r" bgcolor="#d0d
4d80: 30 64 30 22 3e 3c 62 3e 67 3c 2f 62 3e 3c 2f 74 0d0"><b>g</b></t
4d90: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
4da0: 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d 22 23 64 ter" bgcolor="#d
4db0: 30 64 30 64 30 22 3e 3c 62 3e 68 3c 2f 62 3e 3c 0d0d0"><b>h</b><
4dc0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
4dd0: 65 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72 3d 22 enter" bgcolor="
4de0: 23 64 30 64 30 64 30 22 3e 3c 62 3e 69 3c 2f 62 #d0d0d0"><b>i</b
4df0: 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d ></td><td align=
4e00: 22 63 65 6e 74 65 72 22 20 62 67 63 6f 6c 6f 72 "center" bgcolor
4e10: 3d 22 23 64 30 64 30 64 30 22 3e 3c 62 3e 7a 6f ="#d0d0d0"><b>zo
4e20: 66 66 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e 7c ff</b></td><td>|
4e30: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
4e40: 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c <td>\</td><td al
4e50: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f ign="center">0</
4e60: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
4e70: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 nter">0</td><td
4e80: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 20 62 align="center" b
4e90: 67 63 6f 6c 6f 72 3d 22 23 64 30 64 30 64 30 22 gcolor="#d0d0d0"
4ea0: 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >0</td><td align
4eb0: 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e ="center">1</td>
4ec0: 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d <td>/</td></tr>.
4ed0: 0a 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e .<tr><td colspan
4ee0: 3d 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f ="5"><hr></td></
4ef0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f 77 tr>..<tr><td row
4f00: 73 70 61 6e 3d 22 35 22 20 76 61 6c 69 67 6e 3d span="5" valign=
4f10: 22 6d 69 64 64 6c 65 22 3e 49 64 65 6e 74 69 74 "middle">Identit
4f20: 79 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f 74 y</td>..<td>/</t
4f30: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
4f40: 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 ter">1</td><td a
4f50: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
4f60: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
4f70: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
4f80: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
4f90: 30 3c 2f 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 0</td><td>\</td>
4fa0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c </tr>..<tr><td>|
4fb0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
4fc0: 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 center">0</td><t
4fd0: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
4fe0: 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >1</td><td align
4ff0: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
5000: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
5010: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f r">0</td><td>|</
5020: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
5030: 64 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 d>\</td><td alig
5040: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
5050: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
5060: 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c er">0</td><td al
5070: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f ign="center">1</
5080: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
5090: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e nter">0</td><td>
50a0: 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 /</td></tr>..<tr
50b0: 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 ><td>\</td><td a
50c0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
50d0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
50e0: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
50f0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
5100: 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 0</td><td align=
5110: 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c "center">1</td><
5120: 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a td>/</td></tr>..
5130: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d <tr><td colspan=
5140: 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 "5"><hr></td></t
5150: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f 77 73 r>..<tr><td rows
5160: 70 61 6e 3d 22 35 22 20 76 61 6c 69 67 6e 3d 22 pan="5" valign="
5170: 6d 69 64 64 6c 65 22 3e 54 72 61 6e 73 6c 61 74 middle">Translat
5180: 65 28 3c 62 3e 74 78 3c 2f 62 3e 2c 20 3c 62 3e e(<b>tx</b>, <b>
5190: 74 79 3c 2f 62 3e 2c 20 3c 62 3e 74 7a 3c 2f 62 ty</b>, <b>tz</b
51a0: 3e 29 26 6e 62 73 70 3b 26 6e 62 73 70 3b 26 6e >) &n
51b0: 62 73 70 3b 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f bsp;</td>..<td>/
51c0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
51d0: 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 center">1</td><t
51e0: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
51f0: 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >0</td><td align
5200: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
5210: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
5220: 72 22 3e 3c 62 3e 74 78 3c 2f 62 3e 3c 2f 74 64 r"><b>tx</b></td
5230: 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>\</td></tr>
5240: 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e ..<tr><td>|</td>
5250: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
5260: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
5270: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 gn="center">1</t
5280: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
5290: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 ter">0</td><td a
52a0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
52b0: 3e 74 79 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e >ty</b></td><td>
52c0: 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 |</td></tr>..<tr
52d0: 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 ><td>|</td><td a
52e0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
52f0: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
5300: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
5310: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
5320: 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 1</td><td align=
5330: 22 63 65 6e 74 65 72 22 3e 3c 62 3e 74 7a 3c 2f "center"><b>tz</
5340: 62 3e 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 64 b></td><td>|</td
5350: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
5360: 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d \</td><td align=
5370: 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c "center">0</td><
5380: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
5390: 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">0</td><td alig
53a0: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
53b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
53c0: 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 2f 3c er">1</td><td>/<
53d0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
53e0: 74 64 20 63 6f 6c 73 70 61 6e 3d 22 35 22 3e 3c td colspan="5"><
53f0: 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c hr></td></tr>..<
5400: 74 72 3e 3c 74 64 20 72 6f 77 73 70 61 6e 3d 22 tr><td rowspan="
5410: 35 22 20 76 61 6c 69 67 6e 3d 22 6d 69 64 64 6c 5" valign="middl
5420: 65 22 3e 53 63 61 6c 65 28 3c 62 3e 73 78 3c 2f e">Scale(<b>sx</
5430: 62 3e 2c 20 3c 62 3e 73 79 3c 2f 62 3e 2c 20 3c b>, <b>sy</b>, <
5440: 62 3e 73 7a 3c 2f 62 3e 29 3c 2f 74 64 3e 0d 0a b>sz</b>)</td>..
5450: 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 74 64 20 61 6c <td>/</td><td al
5460: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e ign="center"><b>
5470: 73 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 sx</b></td><td a
5480: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
5490: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
54a0: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
54b0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
54c0: 30 3c 2f 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 0</td><td>\</td>
54d0: 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c </tr>..<tr><td>|
54e0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
54f0: 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 center">0</td><t
5500: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
5510: 3e 3c 62 3e 73 79 3c 2f 62 3e 3c 2f 74 64 3e 3c ><b>sy</b></td><
5520: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
5530: 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">0</td><td alig
5540: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
5550: 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>|</td></tr>
5560: 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e ..<tr><td>|</td>
5570: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
5580: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
5590: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 gn="center">0</t
55a0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
55b0: 74 65 72 22 3e 3c 62 3e 73 7a 3c 2f 62 3e 3c 2f ter"><b>sz</b></
55c0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
55d0: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e nter">0</td><td>
55e0: 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 |</td></tr>..<tr
55f0: 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 ><td>\</td><td a
5600: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
5610: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
5620: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
5630: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
5640: 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 0</td><td align=
5650: 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c "center">1</td><
5660: 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a td>/</td></tr>..
5670: 3c 74 72 3e 3c 74 64 20 63 6f 6c 73 70 61 6e 3d <tr><td colspan=
5680: 22 35 22 3e 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 "5"><hr></td></t
5690: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 72 6f 77 73 r>..<tr><td rows
56a0: 70 61 6e 3d 22 35 22 20 76 61 6c 69 67 6e 3d 22 pan="5" valign="
56b0: 6d 69 64 64 6c 65 22 3e 58 20 52 6f 6c 6c 28 3c middle">X Roll(<
56c0: 62 3e 26 74 68 65 74 61 3b 3c 2f 62 3e 29 3c 2f b>θ</b>)</
56d0: 74 64 3e 0d 0a 3c 74 64 3e 2f 3c 2f 74 64 3e 3c td>..<td>/</td><
56e0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
56f0: 22 3e 31 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">1</td><td alig
5700: 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 n="center">0</td
5710: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
5720: 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c er">0</td><td al
5730: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f ign="center">0</
5740: 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 td><td>\</td></t
5750: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 r>..<tr><td>|</t
5760: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
5770: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 ter">0</td><td a
5780: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
5790: 3e 63 6f 73 28 26 74 68 65 74 61 3b 29 3c 2f 62 >cos(θ)</b
57a0: 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d ></td><td align=
57b0: 22 63 65 6e 74 65 72 22 3e 3c 62 3e 2d 73 69 6e "center"><b>-sin
57c0: 28 26 74 68 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 (θ)</b></t
57d0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
57e0: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c ter">0</td><td>|
57f0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
5800: 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 6c <td>|</td><td al
5810: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f ign="center">0</
5820: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
5830: 6e 74 65 72 22 3e 3c 62 3e 73 69 6e 28 26 74 68 nter"><b>sin(&th
5840: 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 eta;)</b></td><t
5850: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
5860: 3e 3c 62 3e 63 6f 73 28 26 74 68 65 74 61 3b 29 ><b>cos(θ)
5870: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 </b></td><td ali
5880: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 gn="center">0</t
5890: 64 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 d><td>|</td></tr
58a0: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 5c 3c 2f 74 64 >..<tr><td>\</td
58b0: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
58c0: 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c er">0</td><td al
58d0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f ign="center">0</
58e0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
58f0: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 nter">0</td><td
5900: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 align="center">1
5910: 3c 2f 74 64 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c </td><td>/</td><
5920: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 20 63 6f /tr>..<tr><td co
5930: 6c 73 70 61 6e 3d 22 35 22 3e 3c 68 72 3e 3c 2f lspan="5"><hr></
5940: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
5950: 64 20 72 6f 77 73 70 61 6e 3d 22 35 22 20 76 61 d rowspan="5" va
5960: 6c 69 67 6e 3d 22 6d 69 64 64 6c 65 22 3e 59 20 lign="middle">Y
5970: 52 6f 6c 6c 28 3c 62 3e 26 74 68 65 74 61 3b 3c Roll(<b>θ<
5980: 2f 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 2f /b>)</td>..<td>/
5990: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
59a0: 63 65 6e 74 65 72 22 3e 3c 62 3e 63 6f 73 28 26 center"><b>cos(&
59b0: 74 68 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 64 3e theta;)</b></td>
59c0: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
59d0: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
59e0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 3e 73 gn="center"><b>s
59f0: 69 6e 28 26 74 68 65 74 61 3b 29 3c 2f 62 3e 3c in(θ)</b><
5a00: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
5a10: 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 enter">0</td><td
5a20: 3e 5c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 >\</td></tr>..<t
5a30: 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 r><td>|</td><td
5a40: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 align="center">0
5a50: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
5a60: 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 center">1</td><t
5a70: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
5a80: 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >0</td><td align
5a90: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
5aa0: 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d <td>|</td></tr>.
5ab0: 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c .<tr><td>|</td><
5ac0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
5ad0: 22 3e 3c 62 3e 2d 73 69 6e 28 26 74 68 65 74 61 "><b>-sin(&theta
5ae0: 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 ;)</b></td><td a
5af0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
5b00: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
5b10: 65 6e 74 65 72 22 3e 3c 62 3e 63 6f 73 28 26 74 enter"><b>cos(&t
5b20: 68 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c heta;)</b></td><
5b30: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
5b40: 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 ">0</td><td>|</t
5b50: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
5b60: 3e 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e >\</td><td align
5b70: 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e ="center">0</td>
5b80: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
5b90: 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 r">0</td><td ali
5ba0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 gn="center">0</t
5bb0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
5bc0: 74 65 72 22 3e 31 3c 2f 74 64 3e 3c 74 64 3e 2f ter">1</td><td>/
5bd0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
5be0: 3c 74 64 20 63 6f 6c 73 70 61 6e 3d 22 35 22 3e <td colspan="5">
5bf0: 3c 68 72 3e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a <hr></td></tr>..
5c00: 3c 74 72 3e 3c 74 64 20 72 6f 77 73 70 61 6e 3d <tr><td rowspan=
5c10: 22 35 22 20 76 61 6c 69 67 6e 3d 22 6d 69 64 64 "5" valign="midd
5c20: 6c 65 22 3e 5a 20 52 6f 6c 6c 28 3c 62 3e 26 74 le">Z Roll(<b>&t
5c30: 68 65 74 61 3b 3c 2f 62 3e 29 3c 2f 74 64 3e 0d heta;</b>)</td>.
5c40: 0a 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 74 64 20 61 .<td>/</td><td a
5c50: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 3c 62 lign="center"><b
5c60: 3e 63 6f 73 28 26 74 68 65 74 61 3b 29 3c 2f 62 >cos(θ)</b
5c70: 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d ></td><td align=
5c80: 22 63 65 6e 74 65 72 22 3e 3c 62 3e 2d 73 69 6e "center"><b>-sin
5c90: 28 26 74 68 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 (θ)</b></t
5ca0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
5cb0: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 ter">0</td><td a
5cc0: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c lign="center">0<
5cd0: 2f 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f /td><td>\</td></
5ce0: 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f tr>..<tr><td>|</
5cf0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
5d00: 6e 74 65 72 22 3e 3c 62 3e 73 69 6e 28 26 74 68 nter"><b>sin(&th
5d10: 65 74 61 3b 29 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 eta;)</b></td><t
5d20: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
5d30: 3e 3c 62 3e 63 6f 73 28 26 74 68 65 74 61 3b 29 ><b>cos(θ)
5d40: 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 </b></td><td ali
5d50: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 gn="center">0</t
5d60: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
5d70: 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 3e 7c ter">0</td><td>|
5d80: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
5d90: 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 6c <td>|</td><td al
5da0: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 30 3c 2f ign="center">0</
5db0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
5dc0: 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 nter">0</td><td
5dd0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 31 align="center">1
5de0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
5df0: 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c 74 center">0</td><t
5e00: 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c d>|</td></tr>..<
5e10: 74 72 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 74 64 tr><td>\</td><td
5e20: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
5e30: 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 0</td><td align=
5e40: 22 63 65 6e 74 65 72 22 3e 30 3c 2f 74 64 3e 3c "center">0</td><
5e50: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
5e60: 22 3e 30 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ">0</td><td alig
5e70: 6e 3d 22 63 65 6e 74 65 72 22 3e 31 3c 2f 74 64 n="center">1</td
5e80: 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>/</td></tr>
5e90: 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 2f 74 64 3e 3c ..<tr><td></td><
5ea0: 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 3e 0d 0a /tr>..</table>..
5eb0: 3c 62 72 3e 3c 68 72 3e 0d 0a 3c 68 33 3e 61 70 <br><hr>..<h3>ap
5ec0: 70 6c 79 69 6e 67 20 61 6e 20 41 66 66 69 6e 65 plying an Affine
5ed0: 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 3c Transformation<
5ee0: 2f 68 33 3e 0d 0a 49 6e 20 6f 72 64 65 72 20 74 /h3>..In order t
5ef0: 6f 20 6d 61 74 65 72 69 61 6c 69 7a 65 20 61 6e o materialize an
5f00: 20 61 66 66 69 6e 65 20 74 72 61 6e 73 66 6f 72 affine transfor
5f10: 6d 61 74 69 6f 6e 20 77 65 20 73 69 6d 70 6c 79 mation we simply
5f20: 20 68 61 76 65 20 74 6f 20 63 6f 6d 70 75 74 65 have to compute
5f30: 20 20 3c 62 3e 28 78 27 2c 20 79 27 2c 20 7a 27 <b>(x', y', z'
5f40: 29 3c 2f 62 3e 20 63 6f 6f 72 64 69 6e 61 74 65 )</b> coordinate
5f50: 73 20 73 74 61 72 74 69 6e 67 20 66 72 6f 6d 20 s starting from
5f60: 3c 62 3e 28 78 2c 20 79 2c 20 7a 29 3c 2f 62 3e <b>(x, y, z)</b>
5f70: 20 66 6f 72 20 65 76 65 72 79 20 70 6f 69 6e 74 for every point
5f80: 20 6f 72 20 76 65 72 74 65 78 20 66 6f 75 6e 64 or vertex found
5f90: 20 69 6e 20 74 68 65 20 69 6e 70 75 74 20 47 65 in the input Ge
5fa0: 6f 6d 65 74 72 79 20 61 63 63 6f 72 64 69 6e 67 ometry according
5fb0: 6c 79 20 74 6f 20 74 68 65 20 66 6f 6c 6c 6f 77 ly to the follow
5fc0: 69 6e 67 20 66 6f 72 6d 75 6c 61 65 3a 0d 0a 3c ing formulae:..<
5fd0: 75 6c 3e 0d 0a 3c 6c 69 3e 3c 62 3e 78 27 20 3d ul>..<li><b>x' =
5fe0: 20 61 2a 78 20 2b 20 62 2a 79 20 2b 20 63 2a 7a a*x + b*y + c*z
5ff0: 20 2b 20 78 6f 66 66 3c 2f 62 3e 3c 2f 6c 69 3e + xoff</b></li>
6000: 0d 0a 3c 6c 69 3e 3c 62 3e 79 27 20 3d 20 64 2a ..<li><b>y' = d*
6010: 78 20 2b 20 65 2a 79 20 2b 20 66 2a 7a 20 2b 20 x + e*y + f*z +
6020: 79 6f 66 66 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c yoff</b></li>..<
6030: 6c 69 3e 3c 62 3e 7a 27 20 3d 20 67 2a 78 20 2b li><b>z' = g*x +
6040: 20 68 2a 79 20 2b 20 69 2a 7a 20 2b 20 7a 6f 66 h*y + i*z + zof
6050: 66 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 6c f</b></li>..</ul
6060: 3e 3c 62 72 3e 0d 0a 69 6e 20 74 68 65 20 73 69 ><br>..in the si
6070: 6d 70 6c 65 72 20 3c 62 3e 32 44 3c 2f 62 3e 20 mpler <b>2D</b>
6080: 63 61 73 65 20 74 68 69 73 20 77 69 6c 6c 20 61 case this will a
6090: 73 73 75 6d 65 20 74 68 65 20 72 65 64 75 63 65 ssume the reduce
60a0: 64 20 66 6f 72 6d 3a 0d 0a 3c 75 6c 3e 0d 0a 3c d form:..<ul>..<
60b0: 6c 69 3e 3c 62 3e 78 27 20 3d 20 61 2a 78 20 2b li><b>x' = a*x +
60c0: 20 62 2a 79 20 2b 20 78 6f 66 66 3c 2f 62 3e 3c b*y + xoff</b><
60d0: 2f 6c 69 3e 0d 0a 3c 6c 69 3e 3c 62 3e 79 27 20 /li>..<li><b>y'
60e0: 3d 20 64 2a 78 20 2b 20 65 2a 79 20 2b 20 79 6f = d*x + e*y + yo
60f0: 66 66 3c 2f 62 3e 3c 2f 6c 69 3e 0d 0a 3c 2f 75 ff</b></li>..</u
6100: 6c 3e 3c 62 72 3e 0d 0a 41 73 20 79 6f 75 20 63 l><br>..As you c
6110: 61 6e 20 6e 6f 74 69 63 65 2c 20 61 70 70 6c 79 an notice, apply
6120: 69 6e 67 20 61 6e 20 41 66 66 69 6e 65 20 54 72 ing an Affine Tr
6130: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 64 6f 65 ansformation doe
6140: 73 20 6e 6f 74 20 72 65 71 75 69 72 65 73 20 63 s not requires c
6150: 6f 6d 70 75 74 69 6e 67 20 61 6e 79 20 74 72 69 omputing any tri
6160: 67 6f 6e 6f 6d 65 74 72 69 63 20 66 75 6e 63 74 gonometric funct
6170: 69 6f 6e 2e 3c 62 72 3e 0d 0a 54 72 69 67 6f 6e ion.<br>..Trigon
6180: 6f 6d 65 74 72 69 63 20 66 75 6e 63 74 69 6f 6e ometric function
6190: 73 20 61 72 65 20 76 65 72 79 20 63 6f 73 74 6c s are very costl
61a0: 79 20 69 6e 20 63 6f 6d 70 75 74 61 74 69 6f 6e y in computation
61b0: 61 6c 20 74 65 72 6d 73 2c 20 73 6f 20 61 70 70 al terms, so app
61c0: 6c 79 69 6e 67 20 61 6e 20 41 66 66 69 6e 65 20 lying an Affine
61d0: 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 69 Transformation i
61e0: 73 20 61 6e 20 69 6e 74 72 69 6e 73 69 63 61 6c s an intrinsical
61f0: 6c 79 20 65 66 66 69 63 69 65 6e 74 20 6d 65 63 ly efficient mec
6200: 68 61 6e 69 73 6d 20 62 65 63 61 75 73 65 20 73 hanism because s
6210: 69 6d 70 6c 79 20 64 65 70 65 6e 64 73 20 6f 6e imply depends on
6220: 20 6d 75 6c 74 69 70 6c 69 63 61 74 69 6f 6e 73 multiplications
6230: 20 61 6e 64 20 61 64 64 69 74 69 6f 6e 73 2e 3c and additions.<
6240: 62 72 3e 0d 0a 3c 62 72 3e 3c 68 72 3e 0d 0a 3c br>..<br><hr>..<
6250: 68 33 3e 63 68 61 69 6e 69 6e 67 20 74 77 6f 20 h3>chaining two
6260: 28 6f 72 20 65 76 65 6e 20 6d 6f 72 65 29 20 41 (or even more) A
6270: 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 ffine Transforma
6280: 74 69 6f 6e 73 20 69 6e 20 61 20 73 69 6e 67 6c tions in a singl
6290: 65 20 6f 70 65 72 61 74 69 6f 6e 3c 2f 68 33 3e e operation</h3>
62a0: 0d 0a 41 66 66 69 6e 65 20 74 72 61 6e 73 66 6f ..Affine transfo
62b0: 72 6d 61 74 69 6f 6e 20 6d 61 74 72 69 63 65 73 rmation matrices
62c0: 20 68 61 76 65 20 61 6e 6f 74 68 65 72 20 61 73 have another as
62d0: 74 6f 6e 69 73 68 69 6e 67 20 70 72 6f 70 65 72 tonishing proper
62e0: 74 79 2e 3c 62 72 3e 0d 0a 57 65 20 63 61 6e 20 ty.<br>..We can
62f0: 3c 61 20 68 72 65 66 3d 22 68 74 74 70 3a 2f 2f <a href="http://
6300: 65 6e 2e 77 69 6b 69 70 65 64 69 61 2e 6f 72 67 en.wikipedia.org
6310: 2f 77 69 6b 69 2f 4d 61 74 72 69 78 5f 6d 75 6c /wiki/Matrix_mul
6320: 74 69 70 6c 69 63 61 74 69 6f 6e 22 3e 6d 75 6c tiplication">mul
6330: 74 69 70 6c 79 3c 2f 61 3e 20 74 77 6f 20 64 69 tiply</a> two di
6340: 66 66 65 72 65 6e 74 20 61 66 66 69 6e 65 20 74 fferent affine t
6350: 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 6d 61 ransformation ma
6360: 74 72 69 63 65 73 20 74 68 75 73 20 6f 62 74 61 trices thus obta
6370: 69 6e 69 6e 67 20 61 20 74 68 69 72 64 20 6d 61 ining a third ma
6380: 74 72 69 78 2c 20 61 6e 64 20 74 68 69 73 20 6c trix, and this l
6390: 61 74 65 73 74 20 6f 6e 63 65 20 61 70 70 6c 69 atest once appli
63a0: 65 64 20 77 69 6c 6c 20 63 6f 6e 74 61 69 6e 20 ed will contain
63b0: 62 6f 74 68 20 74 72 61 6e 73 66 6f 72 6d 61 74 both transformat
63c0: 69 6f 6e 73 20 61 6e 64 20 69 6e 20 74 68 65 20 ions and in the
63d0: 72 69 67 68 74 20 73 65 71 75 65 6e 63 65 2e 3c right sequence.<
63e0: 62 72 3e 0d 0a 54 68 65 72 65 20 69 73 20 6e 6f br>..There is no
63f0: 20 6c 69 6d 69 74 3b 20 77 65 20 63 61 6e 20 69 limit; we can i
6400: 6e 66 69 6e 69 74 69 76 65 6c 79 20 63 68 61 69 nfinitively chai
6410: 6e 20 61 73 20 6d 61 6e 79 20 74 72 61 6e 73 66 n as many transf
6420: 6f 72 6d 61 74 69 6f 6e 73 20 61 73 20 72 65 71 ormations as req
6430: 75 69 72 65 64 2c 20 77 65 27 6c 6c 20 73 69 6d uired, we'll sim
6440: 70 6c 79 20 68 61 76 65 20 74 6f 20 63 6f 6e 74 ply have to cont
6450: 69 6e 75 65 20 6d 75 6c 74 69 70 6c 79 69 6e 67 inue multiplying
6460: 20 61 6c 6c 20 6d 61 74 72 69 63 65 73 20 6f 6e all matrices on
6470: 65 20 61 66 74 65 72 20 74 68 65 20 6f 74 68 65 e after the othe
6480: 72 20 63 61 72 65 66 75 6c 6c 79 20 72 65 73 70 r carefully resp
6490: 65 63 74 69 6e 67 20 74 68 65 20 61 70 70 72 6f ecting the appro
64a0: 70 72 69 61 74 65 20 73 65 71 75 65 6e 63 65 2e priate sequence.
64b0: 3c 62 72 3e 0d 0a 41 74 20 74 68 65 20 65 6e 64 <br>..At the end
64c0: 20 6f 66 20 74 68 65 20 70 72 6f 63 65 73 73 20 of the process
64d0: 77 65 27 6c 6c 20 61 6c 77 61 79 73 20 67 65 74 we'll always get
64e0: 20 6a 75 73 74 20 61 20 73 69 6e 67 6c 65 20 61 just a single a
64f0: 66 66 69 6e 65 20 74 72 61 6e 73 66 6f 72 6d 61 ffine transforma
6500: 74 69 6f 6e 20 6d 61 74 72 69 78 20 66 61 69 74 tion matrix fait
6510: 68 66 75 6c 6c 79 20 72 65 70 72 65 73 65 6e 74 hfully represent
6520: 69 6e 67 20 61 6e 79 20 69 6e 64 69 76 69 64 75 ing any individu
6530: 61 6c 20 74 72 61 6e 73 66 6f 72 6d 61 74 69 6f al transformatio
6540: 6e 20 69 6e 20 74 68 65 20 63 68 61 69 6e 2e 0d n in the chain..
6550: 0a 3c 74 61 62 6c 65 20 62 67 63 6f 6c 6f 72 3d .<table bgcolor=
6560: 22 23 66 66 63 30 30 30 22 20 63 65 6c 6c 70 61 "#ffc000" cellpa
6570: 64 64 69 6e 67 3d 22 31 30 22 3e 3c 74 72 3e 3c dding="10"><tr><
6580: 74 64 3e 0d 0a 54 68 65 20 6d 75 6c 74 69 70 6c td>..The multipl
6590: 69 63 61 74 69 6f 6e 20 62 65 74 77 65 65 6e 20 ication between
65a0: 74 77 6f 20 6d 61 74 72 69 63 65 73 20 3c 75 3e two matrices <u>
65b0: 69 73 20 6e 6f 74 20 61 20 63 6f 6d 6d 75 74 61 is not a commuta
65c0: 74 69 76 65 20 6f 70 65 72 61 74 69 6f 6e 3c 2f tive operation</
65d0: 75 3e 3a 20 74 68 65 20 72 65 6c 61 74 69 76 65 u>: the relative
65e0: 20 6f 72 64 65 72 20 6f 66 20 6f 70 65 72 61 6e order of operan
65f0: 64 73 20 69 73 20 61 62 73 6f 6c 75 74 65 6c 79 ds is absolutely
6600: 20 72 65 6c 65 76 61 6e 74 2e 3c 2f 74 64 3e 3c relevant.</td><
6610: 2f 74 72 3e 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 68 /tr></table>..<h
6620: 33 3e 6d 75 6c 74 69 70 6c 79 69 6e 67 20 74 77 3>multiplying tw
6630: 6f 20 6d 61 74 72 69 63 65 73 3c 2f 68 33 3e 0d o matrices</h3>.
6640: 0a 4d 75 6c 74 69 70 6c 69 63 61 74 69 6f 6e 20 .Multiplication
6650: 69 73 20 6e 6f 74 20 72 65 61 6c 6c 79 20 61 20 is not really a
6660: 73 69 6d 70 6c 65 20 6f 70 65 72 61 74 69 6f 6e simple operation
6670: 20 77 68 65 6e 20 6d 61 74 72 69 63 65 73 20 61 when matrices a
6680: 72 65 20 69 6e 76 6f 6c 76 65 64 20 61 6e 64 20 re involved and
6690: 72 65 71 75 69 72 65 73 20 61 20 72 61 74 68 65 requires a rathe
66a0: 72 20 63 6f 6d 70 6c 65 78 20 70 72 6f 63 65 64 r complex proced
66b0: 75 72 65 3b 20 74 68 65 20 66 6f 6c 6c 6f 77 69 ure; the followi
66c0: 6e 67 20 65 78 61 6d 70 6c 65 20 73 68 6f 77 73 ng example shows
66d0: 20 68 6f 77 20 74 6f 20 6d 75 6c 74 69 70 6c 79 how to multiply
66e0: 20 74 77 6f 20 3c 62 3e 34 20 78 20 34 3c 2f 62 two <b>4 x 4</b
66f0: 3e 20 6d 61 74 72 69 63 65 73 2e 3c 62 72 3e 0d > matrices.<br>.
6700: 0a 3c 74 61 62 6c 65 20 63 65 6c 6c 73 70 61 63 .<table cellspac
6710: 69 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 ing="4" cellpadd
6720: 69 6e 67 3d 22 34 22 3e 0d 0a 3c 74 72 3e 3c 74 ing="4">..<tr><t
6730: 64 3e 0d 0a 3c 74 61 62 6c 65 3e 0d 0a 3c 74 72 d>..<table>..<tr
6740: 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 74 64 20 61 ><td>/</td><td a
6750: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 61 3c lign="center">a<
6760: 73 75 62 3e 31 31 3c 2f 73 75 62 3e 3c 2f 74 64 sub>11</sub></td
6770: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
6780: 65 72 22 3e 61 3c 73 75 62 3e 31 32 3c 2f 73 75 er">a<sub>12</su
6790: 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e b></td><td align
67a0: 3d 22 63 65 6e 74 65 72 22 3e 61 3c 73 75 62 3e ="center">a<sub>
67b0: 31 33 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 13</sub></td><td
67c0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
67d0: 61 3c 73 75 62 3e 31 34 3c 2f 73 75 62 3e 3c 2f a<sub>14</sub></
67e0: 74 64 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c 2f 74 td><td>\</td></t
67f0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 r>..<tr><td>|</t
6800: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
6810: 74 65 72 22 3e 61 3c 73 75 62 3e 32 31 3c 2f 73 ter">a<sub>21</s
6820: 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ub></td><td alig
6830: 6e 3d 22 63 65 6e 74 65 72 22 3e 61 3c 73 75 62 n="center">a<sub
6840: 3e 32 32 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 >22</sub></td><t
6850: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
6860: 3e 61 3c 73 75 62 3e 32 33 3c 2f 73 75 62 3e 3c >a<sub>23</sub><
6870: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
6880: 65 6e 74 65 72 22 3e 61 3c 73 75 62 3e 32 34 3c enter">a<sub>24<
6890: 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 3e 7c 3c /sub></td><td>|<
68a0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
68b0: 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 td>|</td><td ali
68c0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 61 3c 73 75 gn="center">a<su
68d0: 62 3e 33 31 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c b>31</sub></td><
68e0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
68f0: 22 3e 61 3c 73 75 62 3e 33 32 3c 2f 73 75 62 3e ">a<sub>32</sub>
6900: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
6910: 63 65 6e 74 65 72 22 3e 61 3c 73 75 62 3e 33 33 center">a<sub>33
6920: 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 </sub></td><td a
6930: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 61 3c lign="center">a<
6940: 73 75 62 3e 33 34 3c 2f 73 75 62 3e 3c 2f 74 64 sub>34</sub></td
6950: 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e ><td>|</td></tr>
6960: 0d 0a 3c 74 72 3e 3c 74 64 3e 5c 3c 2f 74 64 3e ..<tr><td>\</td>
6970: 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 <td align="cente
6980: 72 22 3e 61 3c 73 75 62 3e 34 31 3c 2f 73 75 62 r">a<sub>41</sub
6990: 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d ></td><td align=
69a0: 22 63 65 6e 74 65 72 22 3e 61 3c 73 75 62 3e 34 "center">a<sub>4
69b0: 32 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 2</sub></td><td
69c0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 61 align="center">a
69d0: 3c 73 75 62 3e 34 33 3c 2f 73 75 62 3e 3c 2f 74 <sub>43</sub></t
69e0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
69f0: 74 65 72 22 3e 61 3c 73 75 62 3e 34 34 3c 2f 73 ter">a<sub>44</s
6a00: 75 62 3e 3c 2f 74 64 3e 3c 74 64 3e 2f 3c 2f 74 ub></td><td>/</t
6a10: 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 62 6c 65 d></tr>..</table
6a20: 3e 0d 0a 3c 2f 74 64 3e 3c 74 64 20 76 61 6c 69 >..</td><td vali
6a30: 67 6e 3d 22 6d 69 64 64 6c 65 22 3e 2a 3c 2f 74 gn="middle">*</t
6a40: 64 3e 0d 0a 3c 74 64 3e 0d 0a 3c 74 61 62 6c 65 d>..<td>..<table
6a50: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 2f 3c 2f 74 64 >..<tr><td>/</td
6a60: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
6a70: 65 72 22 3e 62 3c 73 75 62 3e 31 31 3c 2f 73 75 er">b<sub>11</su
6a80: 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e b></td><td align
6a90: 3d 22 63 65 6e 74 65 72 22 3e 62 3c 73 75 62 3e ="center">b<sub>
6aa0: 31 32 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 12</sub></td><td
6ab0: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
6ac0: 62 3c 73 75 62 3e 31 33 3c 2f 73 75 62 3e 3c 2f b<sub>13</sub></
6ad0: 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 td><td align="ce
6ae0: 6e 74 65 72 22 3e 62 3c 73 75 62 3e 31 34 3c 2f nter">b<sub>14</
6af0: 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 3e 5c 3c 2f sub></td><td>\</
6b00: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
6b10: 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 d>|</td><td alig
6b20: 6e 3d 22 63 65 6e 74 65 72 22 3e 62 3c 73 75 62 n="center">b<sub
6b30: 3e 32 31 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 >21</sub></td><t
6b40: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
6b50: 3e 62 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 3c >b<sub>22</sub><
6b60: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
6b70: 65 6e 74 65 72 22 3e 62 3c 73 75 62 3e 32 33 3c enter">b<sub>23<
6b80: 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c /sub></td><td al
6b90: 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 62 3c 73 ign="center">b<s
6ba0: 75 62 3e 32 34 3c 2f 73 75 62 3e 3c 2f 74 64 3e ub>24</sub></td>
6bb0: 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d <td>|</td></tr>.
6bc0: 0a 3c 74 72 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c .<tr><td>|</td><
6bd0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
6be0: 22 3e 62 3c 73 75 62 3e 33 31 3c 2f 73 75 62 3e ">b<sub>31</sub>
6bf0: 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 </td><td align="
6c00: 63 65 6e 74 65 72 22 3e 62 3c 73 75 62 3e 33 32 center">b<sub>32
6c10: 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 </sub></td><td a
6c20: 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 62 3c lign="center">b<
6c30: 73 75 62 3e 33 33 3c 2f 73 75 62 3e 3c 2f 74 64 sub>33</sub></td
6c40: 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 ><td align="cent
6c50: 65 72 22 3e 62 3c 73 75 62 3e 33 34 3c 2f 73 75 er">b<sub>34</su
6c60: 62 3e 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 64 b></td><td>|</td
6c70: 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e ></tr>..<tr><td>
6c80: 5c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d \</td><td align=
6c90: 22 63 65 6e 74 65 72 22 3e 62 3c 73 75 62 3e 34 "center">b<sub>4
6ca0: 31 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 1</sub></td><td
6cb0: 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e 62 align="center">b
6cc0: 3c 73 75 62 3e 34 32 3c 2f 73 75 62 3e 3c 2f 74 <sub>42</sub></t
6cd0: 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e d><td align="cen
6ce0: 74 65 72 22 3e 62 3c 73 75 62 3e 34 33 3c 2f 73 ter">b<sub>43</s
6cf0: 75 62 3e 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 67 ub></td><td alig
6d00: 6e 3d 22 63 65 6e 74 65 72 22 3e 62 3c 73 75 62 n="center">b<sub
6d10: 3e 34 34 3c 2f 73 75 62 3e 3c 2f 74 64 3e 3c 74 >44</sub></td><t
6d20: 64 3e 2f 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c d>/</td></tr>..<
6d30: 2f 74 61 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 0d 0a /table>..</td>..
6d40: 3c 2f 74 64 3e 3c 74 64 20 76 61 6c 69 67 6e 3d </td><td valign=
6d50: 22 6d 69 64 64 6c 65 22 3e 3d 3c 2f 74 64 3e 0d "middle">=</td>.
6d60: 0a 3c 74 64 3e 0d 0a 3c 74 61 62 6c 65 3e 0d 0a .<td>..<table>..
6d70: 3c 74 72 3e 3c 74 64 3e 2f 3c 2f 74 64 3e 3c 74 <tr><td>/</td><t
6d80: 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 d align="center"
6d90: 3e 0d 0a 28 61 3c 73 75 62 3e 31 31 3c 2f 73 75 >..(a<sub>11</su
6da0: 62 3e 2a 62 3c 73 75 62 3e 31 31 3c 2f 73 75 62 b>*b<sub>11</sub
6db0: 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 32 3c 2f > + ..a<sub>12</
6dc0: 73 75 62 3e 2a 62 3c 73 75 62 3e 32 31 3c 2f 73 sub>*b<sub>21</s
6dd0: 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 33 ub> + ..a<sub>13
6de0: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 31 3c </sub>*b<sub>31<
6df0: 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e /sub> + ..a<sub>
6e00: 31 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 14</sub>*b<sub>4
6e10: 31 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 1</sub>)</td>..<
6e20: 74 64 3e 28 61 3c 73 75 62 3e 31 31 3c 2f 73 75 td>(a<sub>11</su
6e30: 62 3e 2a 62 3c 73 75 62 3e 31 32 3c 2f 73 75 62 b>*b<sub>12</sub
6e40: 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 32 3c 2f > + ..a<sub>12</
6e50: 73 75 62 3e 2a 62 3c 73 75 62 3e 32 32 3c 2f 73 sub>*b<sub>22</s
6e60: 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 33 ub> + ..a<sub>13
6e70: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 32 3c </sub>*b<sub>32<
6e80: 2f 73 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e 31 /sub> +..a<sub>1
6e90: 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 32 4</sub>*b<sub>42
6ea0: 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 </sub>)</td>..<t
6eb0: 64 3e 28 61 3c 73 75 62 3e 31 31 3c 2f 73 75 62 d>(a<sub>11</sub
6ec0: 3e 2a 62 3c 73 75 62 3e 31 33 3c 2f 73 75 62 3e >*b<sub>13</sub>
6ed0: 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 32 3c 2f 73 + ..a<sub>12</s
6ee0: 75 62 3e 2a 62 3c 73 75 62 3e 32 33 3c 2f 73 75 ub>*b<sub>23</su
6ef0: 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 33 3c b> + ..a<sub>13<
6f00: 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 33 3c 2f /sub>*b<sub>33</
6f10: 73 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e 31 34 sub> +..a<sub>14
6f20: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 33 3c </sub>*b<sub>43<
6f30: 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 64 /sub>)</td>..<td
6f40: 3e 28 61 3c 73 75 62 3e 31 31 3c 2f 73 75 62 3e >(a<sub>11</sub>
6f50: 2a 62 3c 73 75 62 3e 31 34 3c 2f 73 75 62 3e 20 *b<sub>14</sub>
6f60: 2b 20 0d 0a 61 3c 73 75 62 3e 31 32 3c 2f 73 75 + ..a<sub>12</su
6f70: 62 3e 2a 62 3c 73 75 62 3e 32 34 3c 2f 73 75 62 b>*b<sub>24</sub
6f80: 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 31 33 3c 2f > + ..a<sub>13</
6f90: 73 75 62 3e 2a 62 3c 73 75 62 3e 33 34 3c 2f 73 sub>*b<sub>34</s
6fa0: 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e 31 34 3c ub> +..a<sub>14<
6fb0: 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 34 3c 2f /sub>*b<sub>44</
6fc0: 73 75 62 3e 29 3c 2f 74 64 3e 3c 74 64 3e 5c 3c sub>)</td><td>\<
6fd0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
6fe0: 74 64 3e 7c 3c 2f 74 64 3e 3c 74 64 20 61 6c 69 td>|</td><td ali
6ff0: 67 6e 3d 22 63 65 6e 74 65 72 22 3e 0d 0a 28 61 gn="center">..(a
7000: 3c 73 75 62 3e 32 31 3c 2f 73 75 62 3e 2a 62 3c <sub>21</sub>*b<
7010: 73 75 62 3e 31 31 3c 2f 73 75 62 3e 20 2b 20 0d sub>11</sub> + .
7020: 0a 61 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 2a .a<sub>22</sub>*
7030: 62 3c 73 75 62 3e 32 31 3c 2f 73 75 62 3e 20 2b b<sub>21</sub> +
7040: 20 0d 0a 61 3c 73 75 62 3e 32 33 3c 2f 73 75 62 ..a<sub>23</sub
7050: 3e 2a 62 3c 73 75 62 3e 33 31 3c 2f 73 75 62 3e >*b<sub>31</sub>
7060: 20 2b 20 0d 0a 61 3c 73 75 62 3e 32 34 3c 2f 73 + ..a<sub>24</s
7070: 75 62 3e 2a 62 3c 73 75 62 3e 34 31 3c 2f 73 75 ub>*b<sub>41</su
7080: 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 28 61 b>)</td>..<td>(a
7090: 3c 73 75 62 3e 32 31 3c 2f 73 75 62 3e 2a 62 3c <sub>21</sub>*b<
70a0: 73 75 62 3e 31 32 3c 2f 73 75 62 3e 20 2b 20 0d sub>12</sub> + .
70b0: 0a 61 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 2a .a<sub>22</sub>*
70c0: 62 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 20 2b b<sub>22</sub> +
70d0: 20 0d 0a 61 3c 73 75 62 3e 32 33 3c 2f 73 75 62 ..a<sub>23</sub
70e0: 3e 2a 62 3c 73 75 62 3e 33 32 3c 2f 73 75 62 3e >*b<sub>32</sub>
70f0: 20 2b 0d 0a 61 3c 73 75 62 3e 32 34 3c 2f 73 75 +..a<sub>24</su
7100: 62 3e 2a 62 3c 73 75 62 3e 34 32 3c 2f 73 75 62 b>*b<sub>42</sub
7110: 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 28 61 3c >)</td>..<td>(a<
7120: 73 75 62 3e 32 31 3c 2f 73 75 62 3e 2a 62 3c 73 sub>21</sub>*b<s
7130: 75 62 3e 31 33 3c 2f 73 75 62 3e 20 2b 20 0d 0a ub>13</sub> + ..
7140: 61 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 2a 62 a<sub>22</sub>*b
7150: 3c 73 75 62 3e 32 33 3c 2f 73 75 62 3e 20 2b 20 <sub>23</sub> +
7160: 0d 0a 61 3c 73 75 62 3e 32 33 3c 2f 73 75 62 3e ..a<sub>23</sub>
7170: 2a 62 3c 73 75 62 3e 33 33 3c 2f 73 75 62 3e 20 *b<sub>33</sub>
7180: 2b 0d 0a 61 3c 73 75 62 3e 32 34 3c 2f 73 75 62 +..a<sub>24</sub
7190: 3e 2a 62 3c 73 75 62 3e 34 33 3c 2f 73 75 62 3e >*b<sub>43</sub>
71a0: 29 3c 2f 74 64 3e 0d 0a 3c 74 64 3e 28 61 3c 73 )</td>..<td>(a<s
71b0: 75 62 3e 32 31 3c 2f 73 75 62 3e 2a 62 3c 73 75 ub>21</sub>*b<su
71c0: 62 3e 31 34 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 b>14</sub> + ..a
71d0: 3c 73 75 62 3e 32 32 3c 2f 73 75 62 3e 2a 62 3c <sub>22</sub>*b<
71e0: 73 75 62 3e 32 34 3c 2f 73 75 62 3e 20 2b 20 0d sub>24</sub> + .
71f0: 0a 61 3c 73 75 62 3e 32 33 3c 2f 73 75 62 3e 2a .a<sub>23</sub>*
7200: 62 3c 73 75 62 3e 33 34 3c 2f 73 75 62 3e 20 2b b<sub>34</sub> +
7210: 0d 0a 61 3c 73 75 62 3e 32 34 3c 2f 73 75 62 3e ..a<sub>24</sub>
7220: 2a 62 3c 73 75 62 3e 34 34 3c 2f 73 75 62 3e 29 *b<sub>44</sub>)
7230: 3c 2f 74 64 3e 3c 74 64 3e 7c 3c 2f 74 64 3e 3c </td><td>|</td><
7240: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 7c 3c /tr>..<tr><td>|<
7250: 2f 74 64 3e 3c 74 64 20 61 6c 69 67 6e 3d 22 63 /td><td align="c
7260: 65 6e 74 65 72 22 3e 0d 0a 28 61 3c 73 75 62 3e enter">..(a<sub>
7270: 33 31 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 31 31</sub>*b<sub>1
7280: 31 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 1</sub> + ..a<su
7290: 62 3e 33 32 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 b>32</sub>*b<sub
72a0: 3e 32 31 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c >21</sub> + ..a<
72b0: 73 75 62 3e 33 33 3c 2f 73 75 62 3e 2a 62 3c 73 sub>33</sub>*b<s
72c0: 75 62 3e 33 31 3c 2f 73 75 62 3e 20 2b 20 0d 0a ub>31</sub> + ..
72d0: 61 3c 73 75 62 3e 33 34 3c 2f 73 75 62 3e 2a 62 a<sub>34</sub>*b
72e0: 3c 73 75 62 3e 34 31 3c 2f 73 75 62 3e 29 3c 2f <sub>41</sub>)</
72f0: 74 64 3e 0d 0a 3c 74 64 3e 28 61 3c 73 75 62 3e td>..<td>(a<sub>
7300: 33 31 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 31 31</sub>*b<sub>1
7310: 32 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 2</sub> + ..a<su
7320: 62 3e 33 32 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 b>32</sub>*b<sub
7330: 3e 32 32 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c >22</sub> + ..a<
7340: 73 75 62 3e 33 33 3c 2f 73 75 62 3e 2a 62 3c 73 sub>33</sub>*b<s
7350: 75 62 3e 33 32 3c 2f 73 75 62 3e 20 2b 0d 0a 61 ub>32</sub> +..a
7360: 3c 73 75 62 3e 33 34 3c 2f 73 75 62 3e 2a 62 3c <sub>34</sub>*b<
7370: 73 75 62 3e 34 32 3c 2f 73 75 62 3e 29 3c 2f 74 sub>42</sub>)</t
7380: 64 3e 0d 0a 3c 74 64 3e 28 61 3c 73 75 62 3e 33 d>..<td>(a<sub>3
7390: 31 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 31 33 1</sub>*b<sub>13
73a0: 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 </sub> + ..a<sub
73b0: 3e 33 32 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e >32</sub>*b<sub>
73c0: 32 33 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 23</sub> + ..a<s
73d0: 75 62 3e 33 33 3c 2f 73 75 62 3e 2a 62 3c 73 75 ub>33</sub>*b<su
73e0: 62 3e 33 33 3c 2f 73 75 62 3e 20 2b 0d 0a 61 3c b>33</sub> +..a<
73f0: 73 75 62 3e 33 34 3c 2f 73 75 62 3e 2a 62 3c 73 sub>34</sub>*b<s
7400: 75 62 3e 34 33 3c 2f 73 75 62 3e 29 3c 2f 74 64 ub>43</sub>)</td
7410: 3e 0d 0a 3c 74 64 3e 28 61 3c 73 75 62 3e 33 31 >..<td>(a<sub>31
7420: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 31 34 3c </sub>*b<sub>14<
7430: 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e /sub> + ..a<sub>
7440: 33 32 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 32 32</sub>*b<sub>2
7450: 34 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 4</sub> + ..a<su
7460: 62 3e 33 33 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 b>33</sub>*b<sub
7470: 3e 33 34 3c 2f 73 75 62 3e 20 2b 0d 0a 61 3c 73 >34</sub> +..a<s
7480: 75 62 3e 33 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 ub>34</sub>*b<su
7490: 62 3e 34 34 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e b>44</sub>)</td>
74a0: 3c 74 64 3e 7c 3c 2f 74 64 3e 3c 2f 74 72 3e 0d <td>|</td></tr>.
74b0: 0a 3c 74 72 3e 3c 74 64 3e 5c 3c 2f 74 64 3e 3c .<tr><td>\</td><
74c0: 74 64 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 td align="center
74d0: 22 3e 0d 0a 28 61 3c 73 75 62 3e 34 31 3c 2f 73 ">..(a<sub>41</s
74e0: 75 62 3e 2a 62 3c 73 75 62 3e 31 31 3c 2f 73 75 ub>*b<sub>11</su
74f0: 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 32 3c b> + ..a<sub>42<
7500: 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 32 31 3c 2f /sub>*b<sub>21</
7510: 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 sub> + ..a<sub>4
7520: 33 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 31 3</sub>*b<sub>31
7530: 3c 2f 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 </sub> + ..a<sub
7540: 3e 34 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e >44</sub>*b<sub>
7550: 34 31 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 41</sub>)</td>..
7560: 3c 74 64 3e 28 61 3c 73 75 62 3e 34 31 3c 2f 73 <td>(a<sub>41</s
7570: 75 62 3e 2a 62 3c 73 75 62 3e 31 32 3c 2f 73 75 ub>*b<sub>12</su
7580: 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 32 3c b> + ..a<sub>42<
7590: 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 32 32 3c 2f /sub>*b<sub>22</
75a0: 73 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 sub> + ..a<sub>4
75b0: 33 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 32 3</sub>*b<sub>32
75c0: 3c 2f 73 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e </sub> +..a<sub>
75d0: 34 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 44</sub>*b<sub>4
75e0: 32 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 2</sub>)</td>..<
75f0: 74 64 3e 28 61 3c 73 75 62 3e 34 31 3c 2f 73 75 td>(a<sub>41</su
7600: 62 3e 2a 62 3c 73 75 62 3e 31 33 3c 2f 73 75 62 b>*b<sub>13</sub
7610: 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 32 3c 2f > + ..a<sub>42</
7620: 73 75 62 3e 2a 62 3c 73 75 62 3e 32 33 3c 2f 73 sub>*b<sub>23</s
7630: 75 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 33 ub> + ..a<sub>43
7640: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 33 3c </sub>*b<sub>33<
7650: 2f 73 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e 34 /sub> +..a<sub>4
7660: 34 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 33 4</sub>*b<sub>43
7670: 3c 2f 73 75 62 3e 29 3c 2f 74 64 3e 0d 0a 3c 74 </sub>)</td>..<t
7680: 64 3e 28 61 3c 73 75 62 3e 34 31 3c 2f 73 75 62 d>(a<sub>41</sub
7690: 3e 2a 62 3c 73 75 62 3e 31 34 3c 2f 73 75 62 3e >*b<sub>14</sub>
76a0: 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 32 3c 2f 73 + ..a<sub>42</s
76b0: 75 62 3e 2a 62 3c 73 75 62 3e 32 34 3c 2f 73 75 ub>*b<sub>24</su
76c0: 62 3e 20 2b 20 0d 0a 61 3c 73 75 62 3e 34 33 3c b> + ..a<sub>43<
76d0: 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 33 34 3c 2f /sub>*b<sub>34</
76e0: 73 75 62 3e 20 2b 0d 0a 61 3c 73 75 62 3e 34 34 sub> +..a<sub>44
76f0: 3c 2f 73 75 62 3e 2a 62 3c 73 75 62 3e 34 34 3c </sub>*b<sub>44<
7700: 2f 73 75 62 3e 29 3c 2f 74 64 3e 3c 74 64 3e 2f /sub>)</td><td>/
7710: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 2f 74 61 </td></tr>..</ta
7720: 62 6c 65 3e 0d 0a 3c 2f 74 64 3e 3c 2f 74 72 3e ble>..</td></tr>
7730: 3c 2f 74 61 62 6c 65 3e 0d 0a 3c 68 33 3e 69 64 </table>..<h3>id
7740: 65 6e 74 69 74 79 20 6d 61 74 72 69 78 3c 2f 68 entity matrix</h
7750: 33 3e 0d 0a 41 6e 20 69 64 65 6e 74 69 74 79 20 3>..An identity
7760: 6d 61 74 72 69 78 20 73 69 6d 70 6c 79 20 63 6f matrix simply co
7770: 72 72 65 73 70 6f 6e 64 73 20 74 6f 20 61 6e 20 rresponds to an
7780: 61 66 66 69 6e 65 20 74 72 61 6e 73 66 6f 72 6d affine transform
7790: 61 74 69 6f 6e 20 6c 61 63 6b 69 6e 67 20 61 6e ation lacking an
77a0: 79 20 61 63 74 75 61 6c 20 65 66 66 65 63 74 3a y actual effect:
77b0: 20 61 74 20 74 68 65 20 65 6e 64 20 6f 66 20 74 at the end of t
77c0: 68 65 20 70 72 6f 63 65 73 73 20 74 68 65 20 74 he process the t
77d0: 72 61 6e 73 66 6f 72 6d 65 64 20 67 65 6f 6d 65 ransformed geome
77e0: 74 72 79 20 77 69 6c 6c 20 62 65 20 65 78 61 63 try will be exac
77f0: 74 6c 79 20 74 68 65 20 73 61 6d 65 20 61 73 20 tly the same as
7800: 62 65 66 6f 72 65 2e 3c 62 72 3e 0d 0a 4d 6f 72 before.<br>..Mor
7810: 65 6f 76 65 72 20 61 6e 20 69 64 65 6e 74 69 74 eover an identit
7820: 79 20 6d 61 74 72 69 78 20 70 6c 61 79 73 20 61 y matrix plays a
7830: 20 73 70 65 63 69 61 6c 20 72 6f 6c 65 20 69 6e special role in
7840: 20 6d 75 6c 74 69 70 6c 69 63 61 74 69 6f 6e 3a multiplication:
7850: 20 74 68 65 20 72 65 73 75 6c 74 69 6e 67 20 6d the resulting m
7860: 61 74 72 69 78 20 77 69 6c 6c 20 61 6c 77 61 79 atrix will alway
7870: 73 20 62 65 20 65 78 61 63 74 6c 79 20 74 68 65 s be exactly the
7880: 20 73 61 6d 65 20 6f 66 20 74 68 65 20 6f 74 68 same of the oth
7890: 65 72 20 6d 61 74 72 69 78 2e 3c 62 72 3e 0d 0a er matrix.<br>..
78a0: 28 3c 69 3e 69 74 27 73 20 6d 6f 72 65 20 6f 72 (<i>it's more or
78b0: 20 6c 65 73 73 20 74 68 65 20 65 71 75 69 76 61 less the equiva
78c0: 6c 65 6e 74 20 6f 66 20 6d 75 6c 74 69 70 6c 79 lent of multiply
78d0: 69 6e 67 20 65 2e 67 2e 20 3c 62 3e 38 2a 31 3d ing e.g. <b>8*1=
78e0: 38 3c 2f 62 3e 20 69 6e 20 61 6e 20 6f 72 64 69 8</b> in an ordi
78f0: 6e 61 72 79 20 73 63 61 6c 61 72 20 6d 75 6c 74 nary scalar mult
7900: 69 70 6c 69 63 61 74 69 6f 6e 3c 2f 69 3e 29 2e iplication</i>).
7910: 3c 62 72 3e 3c 62 72 3e 0d 0a 3c 68 72 3e 0d 0a <br><br>..<hr>..
7920: 3c 68 33 3e 42 6f 72 69 6e 67 20 53 51 4c 20 66 <h3>Boring SQL f
7930: 75 6e 63 74 69 6f 6e 73 3a 20 61 20 66 6f 72 6d unctions: a form
7940: 61 6c 20 65 78 70 6c 61 6e 61 74 69 6f 6e 3c 2f al explanation</
7950: 68 33 3e 0d 0a 3c 74 61 62 6c 65 20 62 6f 72 64 h3>..<table bord
7960: 65 72 3d 22 31 22 20 63 65 6c 6c 73 70 61 63 69 er="1" cellspaci
7970: 6e 67 3d 22 34 22 20 63 65 6c 6c 70 61 64 64 69 ng="4" cellpaddi
7980: 6e 67 3d 22 38 22 20 62 67 63 6f 6c 6f 72 3d 22 ng="8" bgcolor="
7990: 23 66 66 66 30 64 30 22 3e 0d 0a 3c 74 72 3e 3c #fff0d0">..<tr><
79a0: 74 68 20 62 67 63 6f 6c 6f 72 3d 22 23 43 33 42 th bgcolor="#C3B
79b0: 30 39 31 22 3e 53 51 4c 20 46 75 6e 63 74 69 6f 091">SQL Functio
79c0: 6e 3c 2f 74 68 3e 3c 74 68 20 62 67 63 6f 6c 6f n</th><th bgcolo
79d0: 72 3d 22 23 43 33 42 30 39 31 22 3e 44 65 73 63 r="#C3B091">Desc
79e0: 72 69 70 74 69 6f 6e 3c 2f 74 68 3e 3c 2f 74 72 ription</th></tr
79f0: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 >..<tr><td><b>AT
7a00: 4d 5f 54 72 61 6e 73 66 6f 72 6d 20 28 20 42 4c M_Transform ( BL
7a10: 4f 42 20 47 65 6f 6d 65 74 72 79 20 2c 20 42 4c OB Geometry , BL
7a20: 4f 42 20 41 54 2d 6d 61 74 72 69 78 20 29 20 3a OB AT-matrix ) :
7a30: 20 42 4c 4f 42 20 47 65 6f 6d 65 74 72 79 3c 2f BLOB Geometry</
7a40: 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 65 74 75 td><td>Will retu
7a50: 72 6e 20 61 20 6e 65 77 20 47 65 6f 6d 65 74 72 rn a new Geometr
7a60: 79 20 62 79 20 61 70 70 6c 79 69 6e 67 20 61 6e y by applying an
7a70: 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 Affine Transfor
7a80: 6d 61 74 69 6f 6e 20 74 6f 20 74 68 65 20 69 6e mation to the in
7a90: 70 75 74 20 47 65 6f 6d 65 74 72 79 2e 3c 62 72 put Geometry.<br
7aa0: 3e 0d 0a 54 68 65 20 6f 75 74 70 75 74 20 47 65 >..The output Ge
7ab0: 6f 6d 65 74 72 79 20 77 69 6c 6c 20 70 72 65 73 ometry will pres
7ac0: 65 72 76 65 20 74 68 65 20 6f 72 69 67 69 6e 61 erve the origina
7ad0: 6c 20 53 52 49 44 2c 20 64 69 6d 65 6e 73 69 6f l SRID, dimensio
7ae0: 6e 73 20 61 6e 64 20 74 79 70 65 2e 3c 62 72 3e ns and type.<br>
7af0: 0d 0a 4e 55 4c 4c 20 77 69 6c 6c 20 62 65 20 72 ..NULL will be r
7b00: 65 74 75 72 6e 65 64 20 6f 6e 20 69 6e 76 61 6c eturned on inval
7b10: 69 64 20 61 72 67 75 6d 65 6e 74 73 2e 3c 2f 74 id arguments.</t
7b20: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
7b30: 3e 3c 62 3e 41 54 4d 5f 49 73 56 61 6c 69 64 20 ><b>ATM_IsValid
7b40: 28 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 ( BLOB AT-matrix
7b50: 20 29 20 3a 20 42 4f 4f 4c 45 41 4e 3c 2f 74 64 ) : BOOLEAN</td
7b60: 3e 3c 74 64 3e 57 69 6c 6c 20 63 68 65 63 6b 20 ><td>Will check
7b70: 69 66 20 61 20 42 4c 4f 42 20 64 6f 20 72 65 61 if a BLOB do rea
7b80: 6c 6c 79 20 63 6f 72 72 65 73 70 6f 6e 64 20 74 lly correspond t
7b90: 6f 20 61 6e 20 65 6e 63 6f 64 65 64 20 41 66 66 o an encoded Aff
7ba0: 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 ine Transformati
7bb0: 6f 6e 20 4d 61 74 72 69 78 20 74 68 65 6e 20 72 on Matrix then r
7bc0: 65 74 75 72 6e 69 6e 67 20 54 52 55 45 20 6f 72 eturning TRUE or
7bd0: 20 46 41 4c 53 45 2e 3c 62 72 3e 0d 0a 2d 31 20 FALSE.<br>..-1
7be0: 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64 will be returned
7bf0: 20 69 66 20 74 68 65 20 61 72 67 75 6d 65 6e 74 if the argument
7c00: 20 69 73 6e 27 74 20 6f 66 20 74 68 65 20 42 4c isn't of the BL
7c10: 4f 42 20 74 79 70 65 2e 3c 2f 74 64 3e 3c 2f 74 OB type.</td></t
7c20: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 r>..<tr><td><b>A
7c30: 54 4d 5f 41 73 54 65 78 74 20 28 20 42 4c 4f 42 TM_AsText ( BLOB
7c40: 20 41 54 2d 6d 61 74 72 69 78 20 29 20 3a 20 54 AT-matrix ) : T
7c50: 45 58 54 3c 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c EXT</td><td>Will
7c60: 20 72 65 74 75 72 6e 20 61 20 74 65 78 74 20 73 return a text s
7c70: 65 72 69 61 6c 69 7a 65 64 20 72 65 70 72 65 73 erialized repres
7c80: 65 6e 74 61 74 69 6f 6e 20 6f 66 20 74 68 65 20 entation of the
7c90: 4d 61 74 72 69 78 2e 3c 62 72 3e 0d 0a 4e 55 4c Matrix.<br>..NUL
7ca0: 4c 20 77 69 6c 6c 20 62 65 20 72 65 74 75 72 6e L will be return
7cb0: 65 64 20 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 ed on invalid ar
7cc0: 67 75 6d 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 guments.</td></t
7cd0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 r>..<tr><td><b>A
7ce0: 54 4d 5f 4d 75 6c 74 69 70 6c 79 20 28 20 42 4c TM_Multiply ( BL
7cf0: 4f 42 20 41 54 2d 6d 61 74 72 69 78 2d 41 20 2c OB AT-matrix-A ,
7d00: 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 2d BLOB AT-matrix-
7d10: 42 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 B ) : BLOB AT-ma
7d20: 74 72 69 78 3c 2f 74 64 3e 3c 74 64 3e 57 69 6c trix</td><td>Wil
7d30: 6c 20 6d 75 6c 74 69 70 6c 79 20 4d 61 74 72 69 l multiply Matri
7d40: 78 2d 42 20 62 79 20 4d 61 74 72 69 78 2d 41 20 x-B by Matrix-A
7d50: 74 68 65 6e 20 72 65 74 75 72 6e 69 6e 67 20 74 then returning t
7d60: 68 65 20 72 65 73 75 6c 74 69 6e 67 20 4d 61 74 he resulting Mat
7d70: 72 69 78 2e 3c 62 72 3e 0d 0a 4e 55 4c 4c 20 77 rix.<br>..NULL w
7d80: 69 6c 6c 20 62 65 20 72 65 74 75 72 6e 65 64 20 ill be returned
7d90: 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 67 75 6d on invalid argum
7da0: 65 6e 74 73 2e 3c 68 72 3e 0d 0a 3c 75 3e 4e 6f ents.<hr>..<u>No
7db0: 74 65 3c 2f 75 3e 3a 20 74 68 65 20 74 72 61 6e te</u>: the tran
7dc0: 73 66 6f 72 6d 61 74 69 6f 6e 20 64 65 66 69 6e sformation defin
7dd0: 65 64 20 62 79 20 4d 61 74 72 69 78 2d 41 20 28 ed by Matrix-A (
7de0: 6c 65 66 74 20 6f 70 65 72 61 6e 64 29 20 77 69 left operand) wi
7df0: 6c 6c 20 61 6c 77 61 79 73 20 68 61 70 70 65 6e ll always happen
7e00: 20 3c 75 3e 61 66 74 65 72 3c 2f 75 3e 20 61 70 <u>after</u> ap
7e10: 70 6c 79 69 6e 67 20 61 6c 6c 20 74 72 61 6e 73 plying all trans
7e20: 66 6f 72 6d 61 74 69 6f 6e 73 20 64 65 66 69 6e formations defin
7e30: 65 64 20 62 79 20 4d 61 74 72 69 78 2d 42 20 28 ed by Matrix-B (
7e40: 72 69 67 68 74 20 6f 70 65 72 61 6e 64 29 2e 3c right operand).<
7e50: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
7e60: 74 68 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 62 th colspan="2" b
7e70: 67 63 6f 6c 6f 72 3d 22 23 46 30 45 36 38 43 22 gcolor="#F0E68C"
7e80: 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 3e align="center">
7e90: 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 63 72 SQL functions cr
7ea0: 65 61 74 69 6e 67 20 61 6e 64 20 69 6e 69 74 69 eating and initi
7eb0: 61 6c 69 7a 69 6e 67 20 61 20 6e 65 77 20 41 66 alizing a new Af
7ec0: 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 fine Transformat
7ed0: 69 6f 6e 20 4d 61 74 72 69 78 3c 2f 74 68 3e 3c ion Matrix</th><
7ee0: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 /tr>..<tr><td><b
7ef0: 3e 41 54 4d 5f 43 72 65 61 74 65 20 28 20 76 6f >ATM_Create ( vo
7f00: 69 64 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d id ) : BLOB AT-m
7f10: 61 74 72 69 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 atrix</b></td><t
7f20: 64 3e 57 69 6c 6c 20 72 65 74 75 72 6e 20 61 6e d>Will return an
7f30: 20 49 64 65 6e 74 69 74 79 20 41 66 66 69 6e 65 Identity Affine
7f40: 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 Transformation
7f50: 4d 61 74 72 69 78 2e 3c 62 72 3e 0d 0a 4e 55 4c Matrix.<br>..NUL
7f60: 4c 20 69 66 20 61 6e 79 20 65 72 72 6f 72 20 6f L if any error o
7f70: 63 63 75 72 73 2e 3c 2f 74 64 3e 3c 2f 74 72 3e ccurs.</td></tr>
7f80: 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 4d ..<tr><td><b>ATM
7f90: 5f 43 72 65 61 74 65 20 28 20 64 6f 75 62 6c 65 _Create ( double
7fa0: 20 61 20 2c 20 64 6f 75 62 6c 65 20 62 20 2c 20 a , double b ,
7fb0: 64 6f 75 62 6c 65 20 64 20 2c 20 64 6f 75 62 6c double d , doubl
7fc0: 65 20 65 20 2c 20 64 6f 75 62 6c 65 20 78 6f 66 e e , double xof
7fd0: 66 20 2c 20 64 6f 75 62 6c 65 20 79 6f 66 66 20 f , double yoff
7fe0: 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 ) : BLOB AT-matr
7ff0: 69 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e 57 ix</b></td><td>W
8000: 69 6c 6c 20 72 65 74 75 72 6e 20 61 20 32 44 20 ill return a 2D
8010: 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d Affine Transform
8020: 61 74 69 6f 6e 20 4d 61 74 72 69 78 20 69 6e 69 ation Matrix ini
8030: 74 69 61 6c 69 7a 65 64 20 77 69 74 68 20 65 78 tialized with ex
8040: 70 6c 69 63 69 74 20 76 61 6c 75 65 73 2e 3c 62 plicit values.<b
8050: 72 3e 0d 0a 4e 55 4c 4c 20 69 66 20 61 6e 79 20 r>..NULL if any
8060: 65 72 72 6f 72 20 6f 63 63 75 72 73 20 6f 72 20 error occurs or
8070: 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 67 75 6d on invalid argum
8080: 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d ents.</td></tr>.
8090: 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 4d 5f .<tr><td><b>ATM_
80a0: 43 72 65 61 74 65 20 28 20 64 6f 75 62 6c 65 20 Create ( double
80b0: 61 20 2c 20 64 6f 75 62 6c 65 20 62 20 2c 20 64 a , double b , d
80c0: 6f 75 62 6c 65 20 63 20 2c 20 64 6f 75 62 6c 65 ouble c , double
80d0: 20 64 20 2c 20 64 6f 75 62 6c 65 20 65 20 2c 20 d , double e ,
80e0: 64 6f 75 62 6c 65 20 66 20 2c 20 64 6f 75 62 6c double f , doubl
80f0: 65 20 67 20 2c 20 64 6f 75 62 6c 65 20 68 20 2c e g , double h ,
8100: 20 64 6f 75 62 6c 65 20 69 20 2c 20 64 6f 75 62 double i , doub
8110: 6c 65 20 78 6f 66 66 20 2c 20 64 6f 75 62 6c 65 le xoff , double
8120: 20 79 6f 66 66 20 2c 20 64 6f 75 62 6c 65 20 64 yoff , double d
8130: 6f 75 62 6c 65 20 7a 6f 66 66 20 29 20 3a 20 42 ouble zoff ) : B
8140: 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 LOB AT-matrix</b
8150: 3e 3c 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 ></td><td>Will r
8160: 65 74 75 72 6e 20 61 20 33 44 20 41 66 66 69 6e eturn a 3D Affin
8170: 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e e Transformation
8180: 20 4d 61 74 72 69 78 20 69 6e 69 74 69 61 6c 69 Matrix initiali
8190: 7a 65 64 20 77 69 74 68 20 65 78 70 6c 69 63 69 zed with explici
81a0: 74 20 76 61 6c 75 65 73 2e 3c 62 72 3e 0d 0a 4e t values.<br>..N
81b0: 55 4c 4c 20 69 66 20 61 6e 79 20 65 72 72 6f 72 ULL if any error
81c0: 20 6f 63 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e occurs or on in
81d0: 76 61 6c 69 64 20 61 72 67 75 6d 65 6e 74 73 2e valid arguments.
81e0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
81f0: 3c 74 64 3e 3c 62 3e 41 54 4d 5f 43 72 65 61 74 <td><b>ATM_Creat
8200: 65 54 72 61 6e 73 6c 61 74 65 20 28 20 64 6f 75 eTranslate ( dou
8210: 62 6c 65 20 74 78 20 2c 20 64 6f 75 62 6c 65 20 ble tx , double
8220: 74 79 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d ty ) : BLOB AT-m
8230: 61 74 72 69 78 3c 2f 62 3e 3c 62 72 3e 0d 0a 3c atrix</b><br>..<
8240: 62 3e 41 54 4d 5f 43 72 65 61 74 65 54 72 61 6e b>ATM_CreateTran
8250: 73 6c 61 74 65 20 28 20 64 6f 75 62 6c 65 20 74 slate ( double t
8260: 78 20 2c 20 64 6f 75 62 6c 65 20 74 79 20 2c 20 x , double ty ,
8270: 64 6f 75 62 6c 65 20 74 7a 20 29 20 3a 20 42 4c double tz ) : BL
8280: 4f 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 3e OB AT-matrix</b>
8290: 3c 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 65 </td><td>Will re
82a0: 74 75 72 6e 20 61 6e 20 41 66 66 69 6e 65 20 54 turn an Affine T
82b0: 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d 61 ransformation Ma
82c0: 74 72 69 78 20 69 6e 69 74 69 61 6c 69 7a 65 64 trix initialized
82d0: 20 72 65 73 70 65 63 74 69 76 65 6c 79 20 61 73 respectively as
82e0: 20 61 20 32 44 20 6f 72 20 33 44 20 54 72 61 6e a 2D or 3D Tran
82f0: 73 6c 61 74 65 2e 3c 62 72 3e 0d 0a 4e 55 4c 4c slate.<br>..NULL
8300: 20 69 66 20 61 6e 79 20 65 72 72 6f 72 20 6f 63 if any error oc
8310: 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e 76 61 6c curs or on inval
8320: 69 64 20 61 72 67 75 6d 65 6e 74 73 2e 3c 2f 74 id arguments.</t
8330: 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 d></tr>..<tr><td
8340: 3e 3c 62 3e 41 54 4d 5f 43 72 65 61 74 65 53 63 ><b>ATM_CreateSc
8350: 61 6c 65 20 28 20 64 6f 75 62 6c 65 20 73 78 20 ale ( double sx
8360: 2c 20 64 6f 75 62 6c 65 20 73 79 20 29 20 3a 20 , double sy ) :
8370: 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f BLOB AT-matrix</
8380: 62 3e 3c 62 72 3e 0d 0a 3c 62 3e 41 54 4d 5f 43 b><br>..<b>ATM_C
8390: 72 65 61 74 65 53 63 61 6c 65 20 28 20 64 6f 75 reateScale ( dou
83a0: 62 6c 65 20 73 78 20 2c 20 64 6f 75 62 6c 65 20 ble sx , double
83b0: 73 79 20 2c 20 64 6f 75 62 6c 65 20 73 7a 20 29 sy , double sz )
83c0: 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 : BLOB AT-matri
83d0: 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e 57 69 x</b></td><td>Wi
83e0: 6c 6c 20 72 65 74 75 72 6e 20 61 6e 20 41 66 66 ll return an Aff
83f0: 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 ine Transformati
8400: 6f 6e 20 4d 61 74 72 69 78 20 69 6e 69 74 69 61 on Matrix initia
8410: 6c 69 7a 65 64 20 72 65 73 70 65 63 74 69 76 65 lized respective
8420: 6c 79 20 61 73 20 61 20 32 44 20 6f 72 20 33 44 ly as a 2D or 3D
8430: 20 53 63 61 6c 65 2e 3c 62 72 3e 0d 0a 4e 55 4c Scale.<br>..NUL
8440: 4c 20 69 66 20 61 6e 79 20 65 72 72 6f 72 20 6f L if any error o
8450: 63 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e 76 61 ccurs or on inva
8460: 6c 69 64 20 61 72 67 75 6d 65 6e 74 73 2e 2e 3c lid arguments..<
8470: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
8480: 74 64 3e 3c 62 3e 41 54 4d 5f 43 72 65 61 74 65 td><b>ATM_Create
8490: 52 6f 74 61 74 65 20 28 20 64 6f 75 62 6c 65 20 Rotate ( double
84a0: 61 6e 67 6c 65 49 6e 44 65 67 72 65 65 73 20 29 angleInDegrees )
84b0: 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 : BLOB AT-matri
84c0: 78 3c 2f 62 3e 3c 62 72 3e 0d 0a 3c 62 3e 41 54 x</b><br>..<b>AT
84d0: 4d 5f 43 72 65 61 74 65 5a 52 6f 6c 6c 20 28 20 M_CreateZRoll (
84e0: 64 6f 75 62 6c 65 20 61 6e 67 6c 65 49 6e 44 65 double angleInDe
84f0: 67 72 65 65 73 20 29 20 3a 20 42 4c 4f 42 20 41 grees ) : BLOB A
8500: 54 2d 6d 61 74 72 69 78 3c 2f 62 3e 3c 2f 74 64 T-matrix</b></td
8510: 3e 3c 74 64 3e 57 69 6c 6c 20 72 65 74 75 72 6e ><td>Will return
8520: 20 61 6e 20 41 66 66 69 6e 65 20 54 72 61 6e 73 an Affine Trans
8530: 66 6f 72 6d 61 74 69 6f 6e 20 4d 61 74 72 69 78 formation Matrix
8540: 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 61 73 20 initialized as
8550: 52 6f 74 61 74 69 6f 6e 20 61 72 6f 75 6e 64 20 Rotation around
8560: 74 68 65 20 5a 20 61 78 69 73 2e 3c 62 72 3e 0d the Z axis.<br>.
8570: 0a 4e 55 4c 4c 20 69 66 20 61 6e 79 20 65 72 72 .NULL if any err
8580: 6f 72 20 6f 63 63 75 72 73 20 6f 72 20 6f 6e 20 or occurs or on
8590: 69 6e 76 61 6c 69 64 20 61 72 67 75 6d 65 6e 74 invalid argument
85a0: 73 2e 3c 68 72 3e 0d 0a 54 68 65 20 61 6e 67 6c s.<hr>..The angl
85b0: 65 20 69 73 20 61 6c 77 61 79 73 20 65 78 70 65 e is always expe
85c0: 63 74 65 64 20 74 6f 20 62 65 20 6d 65 61 73 75 cted to be measu
85d0: 72 65 64 20 69 6e 20 64 65 63 69 6d 61 6c 20 64 red in decimal d
85e0: 65 67 72 65 65 73 2e 20 54 68 65 20 64 69 72 65 egrees. The dire
85f0: 63 74 69 6f 6e 20 6f 66 20 72 6f 74 61 74 69 6f ction of rotatio
8600: 6e 20 69 73 20 64 65 66 69 6e 65 64 20 73 75 63 n is defined suc
8610: 68 20 74 68 61 74 20 70 6f 73 69 74 69 76 65 20 h that positive
8620: 61 6e 67 6c 65 73 20 72 6f 74 61 74 65 20 69 6e angles rotate in
8630: 20 74 68 65 20 64 69 72 65 63 74 69 6f 6e 20 66 the direction f
8640: 72 6f 6d 20 74 68 65 20 70 6f 73 69 74 69 76 65 rom the positive
8650: 20 58 20 61 78 69 73 20 74 6f 77 61 72 64 20 74 X axis toward t
8660: 68 65 20 70 6f 73 69 74 69 76 65 20 59 20 61 78 he positive Y ax
8670: 69 73 2e 20 57 69 74 68 20 74 68 65 20 64 65 66 is. With the def
8680: 61 75 6c 74 20 61 78 69 73 20 6f 72 69 65 6e 74 ault axis orient
8690: 61 74 69 6f 6e 20 20 70 6f 73 69 74 69 76 65 20 ation positive
86a0: 61 6e 67 6c 65 73 20 72 6f 74 61 74 65 20 69 6e angles rotate in
86b0: 20 61 20 63 6f 75 6e 74 65 72 63 6c 6f 63 6b 77 a counterclockw
86c0: 69 73 65 20 64 69 72 65 63 74 69 6f 6e 2e 3c 68 ise direction.<h
86d0: 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e 3a r>..<u>Note</u>:
86e0: 20 74 68 69 73 20 69 73 20 74 68 65 20 75 6e 69 this is the uni
86f0: 71 75 65 20 72 6f 74 61 74 69 6f 6e 20 61 6c 6c que rotation all
8700: 6f 77 65 64 20 6f 6e 20 61 20 70 75 72 65 6c 79 owed on a purely
8710: 20 32 44 20 70 6c 61 6e 65 2e 3c 2f 74 64 3e 3c 2D plane.</td><
8720: 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 /tr>..<tr><td><b
8730: 3e 41 54 4d 5f 43 72 65 61 74 65 58 52 6f 6c 6c >ATM_CreateXRoll
8740: 20 28 20 64 6f 75 62 6c 65 20 61 6e 67 6c 65 49 ( double angleI
8750: 6e 44 65 67 72 65 65 73 20 29 20 3a 20 42 4c 4f nDegrees ) : BLO
8760: 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 3e 3c B AT-matrix</b><
8770: 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 65 74 /td><td>Will ret
8780: 75 72 6e 20 61 6e 20 41 66 66 69 6e 65 20 54 72 urn an Affine Tr
8790: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d 61 74 ansformation Mat
87a0: 72 69 78 20 69 6e 69 74 69 61 6c 69 7a 65 64 20 rix initialized
87b0: 61 73 20 52 6f 74 61 74 69 6f 6e 20 61 72 6f 75 as Rotation arou
87c0: 6e 64 20 74 68 65 20 58 20 61 78 69 73 2e 3c 62 nd the X axis.<b
87d0: 72 3e 0d 0a 4e 55 4c 4c 20 69 66 20 61 6e 79 20 r>..NULL if any
87e0: 65 72 72 6f 72 20 6f 63 63 75 72 73 20 6f 72 20 error occurs or
87f0: 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 67 75 6d on invalid argum
8800: 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 72 3e 0d ents.</td></tr>.
8810: 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 4d 5f .<tr><td><b>ATM_
8820: 43 72 65 61 74 65 59 52 6f 6c 6c 20 28 20 64 6f CreateYRoll ( do
8830: 75 62 6c 65 20 61 6e 67 6c 65 49 6e 44 65 67 72 uble angleInDegr
8840: 65 65 73 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d ees ) : BLOB AT-
8850: 6d 61 74 72 69 78 3c 2f 62 3e 3c 2f 74 64 3e 3c matrix</b></td><
8860: 74 64 3e 57 69 6c 6c 20 72 65 74 75 72 6e 20 61 td>Will return a
8870: 6e 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f n Affine Transfo
8880: 72 6d 61 74 69 6f 6e 20 4d 61 74 72 69 78 20 69 rmation Matrix i
8890: 6e 69 74 69 61 6c 69 7a 65 64 20 61 73 20 52 6f nitialized as Ro
88a0: 74 61 74 69 6f 6e 20 61 72 6f 75 6e 64 20 74 68 tation around th
88b0: 65 20 59 20 61 78 69 73 2e 3c 62 72 3e 0d 0a 4e e Y axis.<br>..N
88c0: 55 4c 4c 20 69 66 20 61 6e 79 20 65 72 72 6f 72 ULL if any error
88d0: 20 6f 63 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e occurs or on in
88e0: 76 61 6c 69 64 20 61 72 67 75 6d 65 6e 74 73 2e valid arguments.
88f0: 3c 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e </td></tr>..<tr>
8900: 3c 74 68 20 63 6f 6c 73 70 61 6e 3d 22 32 22 20 <th colspan="2"
8910: 62 67 63 6f 6c 6f 72 3d 22 23 46 30 45 36 38 43 bgcolor="#F0E68C
8920: 22 20 61 6c 69 67 6e 3d 22 63 65 6e 74 65 72 22 " align="center"
8930: 3e 53 51 4c 20 66 75 6e 63 74 69 6f 6e 73 20 73 >SQL functions s
8940: 75 70 70 6f 72 74 69 6e 67 20 63 68 61 69 6e 69 upporting chaini
8950: 6e 67 20 74 77 6f 20 41 66 66 69 6e 65 20 54 72 ng two Affine Tr
8960: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d 61 74 ansformation Mat
8970: 72 69 63 65 73 3c 2f 74 68 3e 3c 2f 74 72 3e 0d rices</th></tr>.
8980: 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 4d 5f .<tr><td><b>ATM_
8990: 54 72 61 6e 73 6c 61 74 65 20 28 20 42 4c 4f 42 Translate ( BLOB
89a0: 20 41 54 2d 6d 61 74 72 69 78 20 2c 20 64 6f 75 AT-matrix , dou
89b0: 62 6c 65 20 74 78 20 2c 20 64 6f 75 62 6c 65 20 ble tx , double
89c0: 74 79 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d ty ) : BLOB AT-m
89d0: 61 74 72 69 78 3c 2f 62 3e 3c 62 72 3e 0d 0a 3c atrix</b><br>..<
89e0: 62 3e 41 54 4d 5f 54 72 61 6e 73 6c 61 74 65 20 b>ATM_Translate
89f0: 28 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 ( BLOB AT-matrix
8a00: 20 2c 20 64 6f 75 62 6c 65 20 74 78 20 2c 20 64 , double tx , d
8a10: 6f 75 62 6c 65 20 74 79 20 2c 20 64 6f 75 62 6c ouble ty , doubl
8a20: 65 20 74 7a 20 29 20 3a 20 42 4c 4f 42 20 41 54 e tz ) : BLOB AT
8a30: 2d 6d 61 74 72 69 78 3c 2f 62 3e 3c 2f 74 64 3e -matrix</b></td>
8a40: 3c 74 64 3e 57 69 6c 6c 20 72 65 74 75 72 6e 20 <td>Will return
8a50: 61 6e 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 an Affine Transf
8a60: 6f 72 6d 61 74 69 6f 6e 20 4d 61 74 72 69 78 20 ormation Matrix
8a70: 62 79 20 63 68 61 69 6e 69 6e 67 20 72 65 73 70 by chaining resp
8a80: 65 63 74 69 76 65 6c 79 20 61 20 32 44 20 6f 72 ectively a 2D or
8a90: 20 33 44 20 54 72 61 6e 73 6c 61 74 65 20 61 6e 3D Translate an
8aa0: 64 20 61 6e 6f 74 68 65 72 20 41 66 66 69 6e 65 d another Affine
8ab0: 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 2e Transformation.
8ac0: 3c 62 72 3e 0d 0a 4e 55 4c 4c 20 69 66 20 61 6e <br>..NULL if an
8ad0: 79 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 6f y error occurs o
8ae0: 72 20 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 67 r on invalid arg
8af0: 75 6d 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 72 uments.</td></tr
8b00: 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 54 >..<tr><td><b>AT
8b10: 4d 5f 53 63 61 6c 65 20 28 20 42 4c 4f 42 20 41 M_Scale ( BLOB A
8b20: 54 2d 6d 61 74 72 69 78 20 2c 20 64 6f 75 62 6c T-matrix , doubl
8b30: 65 20 73 78 20 2c 20 64 6f 75 62 6c 65 20 73 79 e sx , double sy
8b40: 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 74 ) : BLOB AT-mat
8b50: 72 69 78 3c 2f 62 3e 3c 62 72 3e 0d 0a 3c 62 3e rix</b><br>..<b>
8b60: 41 54 4d 5f 53 63 61 6c 65 20 28 20 42 4c 4f 42 ATM_Scale ( BLOB
8b70: 20 41 54 2d 6d 61 74 72 69 78 20 2c 20 64 6f 75 AT-matrix , dou
8b80: 62 6c 65 20 73 78 20 2c 20 64 6f 75 62 6c 65 20 ble sx , double
8b90: 73 79 20 2c 20 64 6f 75 62 6c 65 20 73 7a 20 29 sy , double sz )
8ba0: 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 : BLOB AT-matri
8bb0: 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 3e 57 69 x</b></td><td>Wi
8bc0: 6c 6c 20 72 65 74 75 72 6e 20 61 6e 20 41 66 66 ll return an Aff
8bd0: 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 ine Transformati
8be0: 6f 6e 20 4d 61 74 72 69 78 20 62 79 20 63 68 61 on Matrix by cha
8bf0: 69 6e 69 6e 67 20 72 65 73 70 65 63 74 69 76 65 ining respective
8c00: 6c 79 20 61 20 32 44 20 6f 72 20 33 44 20 53 63 ly a 2D or 3D Sc
8c10: 61 6c 65 20 61 6e 64 20 61 6e 6f 74 68 65 72 20 ale and another
8c20: 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d Affine Transform
8c30: 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 4e 55 4c 4c ation.<br>..NULL
8c40: 20 69 66 20 61 6e 79 20 65 72 72 6f 72 20 6f 63 if any error oc
8c50: 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e 76 61 6c curs or on inval
8c60: 69 64 20 61 72 67 75 6d 65 6e 74 73 2e 2e 3c 2f id arguments..</
8c70: 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c 74 td></tr>..<tr><t
8c80: 64 3e 3c 62 3e 41 54 4d 5f 52 6f 74 61 74 65 20 d><b>ATM_Rotate
8c90: 28 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 ( BLOB AT-matrix
8ca0: 20 2c 20 64 6f 75 62 6c 65 20 61 6e 67 6c 65 49 , double angleI
8cb0: 6e 44 65 67 72 65 65 73 20 29 20 3a 20 42 4c 4f nDegrees ) : BLO
8cc0: 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 3e 3c B AT-matrix</b><
8cd0: 62 72 3e 0d 0a 3c 62 3e 41 54 4d 5f 5a 52 6f 6c br>..<b>ATM_ZRol
8ce0: 6c 20 28 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 l ( BLOB AT-matr
8cf0: 69 78 20 2c 20 64 6f 75 62 6c 65 20 61 6e 67 6c ix , double angl
8d00: 65 49 6e 44 65 67 72 65 65 73 20 29 20 3a 20 42 eInDegrees ) : B
8d10: 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 LOB AT-matrix</b
8d20: 3e 3c 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 ></td><td>Will r
8d30: 65 74 75 72 6e 20 61 6e 20 41 66 66 69 6e 65 20 eturn an Affine
8d40: 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d Transformation M
8d50: 61 74 72 69 78 20 62 79 20 63 68 61 69 6e 69 6e atrix by chainin
8d60: 67 20 61 20 52 6f 74 61 74 69 6f 6e 20 61 72 6f g a Rotation aro
8d70: 75 6e 64 20 74 68 65 20 5a 20 61 78 69 73 20 61 und the Z axis a
8d80: 6e 64 20 61 6e 6f 74 68 65 72 20 41 66 66 69 6e nd another Affin
8d90: 65 20 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e e Transformation
8da0: 2e 3c 62 72 3e 0d 0a 4e 55 4c 4c 20 69 66 20 61 .<br>..NULL if a
8db0: 6e 79 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 ny error occurs
8dc0: 6f 72 20 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 or on invalid ar
8dd0: 67 75 6d 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 guments.</td></t
8de0: 72 3e 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 62 3e 41 r>..<tr><td><b>A
8df0: 54 4d 5f 58 52 6f 6c 6c 20 28 20 42 4c 4f 42 20 TM_XRoll ( BLOB
8e00: 41 54 2d 6d 61 74 72 69 78 20 2c 20 64 6f 75 62 AT-matrix , doub
8e10: 6c 65 20 61 6e 67 6c 65 49 6e 44 65 67 72 65 65 le angleInDegree
8e20: 73 20 29 20 3a 20 42 4c 4f 42 20 41 54 2d 6d 61 s ) : BLOB AT-ma
8e30: 74 72 69 78 3c 2f 62 3e 3c 2f 74 64 3e 3c 74 64 trix</b></td><td
8e40: 3e 57 69 6c 6c 20 72 65 74 75 72 6e 20 61 6e 20 >Will return an
8e50: 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f 72 6d Affine Transform
8e60: 61 74 69 6f 6e 20 4d 61 74 72 69 78 20 62 79 20 ation Matrix by
8e70: 63 68 61 69 6e 69 6e 67 20 61 20 52 6f 74 61 74 chaining a Rotat
8e80: 69 6f 6e 20 61 72 6f 75 6e 64 20 74 68 65 20 58 ion around the X
8e90: 20 61 78 69 73 20 61 6e 64 20 61 6e 6f 74 68 65 axis and anothe
8ea0: 72 20 41 66 66 69 6e 65 20 54 72 61 6e 73 66 6f r Affine Transfo
8eb0: 72 6d 61 74 69 6f 6e 2e 3c 62 72 3e 0d 0a 4e 55 rmation.<br>..NU
8ec0: 4c 4c 20 69 66 20 61 6e 79 20 65 72 72 6f 72 20 LL if any error
8ed0: 6f 63 63 75 72 73 20 6f 72 20 6f 6e 20 69 6e 76 occurs or on inv
8ee0: 61 6c 69 64 20 61 72 67 75 6d 65 6e 74 73 2e 3c alid arguments.<
8ef0: 2f 74 64 3e 3c 2f 74 72 3e 0d 0a 3c 74 72 3e 3c /td></tr>..<tr><
8f00: 74 64 3e 3c 62 3e 41 54 4d 5f 59 52 6f 6c 6c 20 td><b>ATM_YRoll
8f10: 28 20 42 4c 4f 42 20 41 54 2d 6d 61 74 72 69 78 ( BLOB AT-matrix
8f20: 20 2c 20 64 6f 75 62 6c 65 20 61 6e 67 6c 65 49 , double angleI
8f30: 6e 44 65 67 72 65 65 73 20 29 20 3a 20 42 4c 4f nDegrees ) : BLO
8f40: 42 20 41 54 2d 6d 61 74 72 69 78 3c 2f 62 3e 3c B AT-matrix</b><
8f50: 2f 74 64 3e 3c 74 64 3e 57 69 6c 6c 20 72 65 74 /td><td>Will ret
8f60: 75 72 6e 20 61 6e 20 41 66 66 69 6e 65 20 54 72 urn an Affine Tr
8f70: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d 61 74 ansformation Mat
8f80: 72 69 78 20 62 79 20 63 68 61 69 6e 69 6e 67 20 rix by chaining
8f90: 61 20 52 6f 74 61 74 69 6f 6e 20 61 72 6f 75 6e a Rotation aroun
8fa0: 64 20 74 68 65 20 59 20 61 78 69 73 20 61 6e 64 d the Y axis and
8fb0: 20 61 6e 6f 74 68 65 72 20 41 66 66 69 6e 65 20 another Affine
8fc0: 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 2e 3c Transformation.<
8fd0: 62 72 3e 0d 0a 4e 55 4c 4c 20 69 66 20 61 6e 79 br>..NULL if any
8fe0: 20 65 72 72 6f 72 20 6f 63 63 75 72 73 20 6f 72 error occurs or
8ff0: 20 6f 6e 20 69 6e 76 61 6c 69 64 20 61 72 67 75 on invalid argu
9000: 6d 65 6e 74 73 2e 3c 2f 74 64 3e 3c 2f 74 72 3e ments.</td></tr>
9010: 0d 0a 3c 74 72 3e 3c 74 64 3e 3c 2f 74 64 3e 3c ..<tr><td></td><
9020: 74 64 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c 2f 75 3e td>..<u>Note</u>
9030: 3a 20 61 6c 6c 20 74 68 65 20 61 62 6f 76 65 20 : all the above
9040: 66 75 6e 63 74 69 6f 6e 73 20 73 69 6d 70 6c 79 functions simply
9050: 20 61 72 65 20 63 6f 6e 76 65 6e 69 65 6e 63 65 are convenience
9060: 20 6d 65 74 68 6f 64 73 20 69 6e 74 65 6e 64 65 methods intende
9070: 64 20 74 6f 20 61 76 6f 69 64 20 61 6e 79 20 6e d to avoid any n
9080: 65 65 64 20 74 6f 20 72 65 70 65 61 74 65 64 6c eed to repeatedl
9090: 79 20 63 61 6c 6c 20 3c 62 3e 41 54 4d 5f 4d 75 y call <b>ATM_Mu
90a0: 6c 74 69 70 6c 79 28 29 3c 2f 62 3e 2e 0d 0a 3c ltiply()</b>...<
90b0: 76 65 72 62 61 74 69 6d 3e 0d 0a 53 45 4c 45 43 verbatim>..SELEC
90c0: 54 20 41 54 4d 5f 4d 75 6c 74 69 70 6c 79 28 41 T ATM_Multiply(A
90d0: 54 4d 5f 43 72 65 61 74 65 52 6f 74 61 74 65 28 TM_CreateRotate(
90e0: 31 35 29 2c 20 0d 0a 20 20 20 20 20 20 20 20 20 15), ..
90f0: 20 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f 4d ATM_M
9100: 75 6c 74 69 70 6c 79 28 41 54 4d 5f 43 72 65 61 ultiply(ATM_Crea
9110: 74 65 53 63 61 6c 65 28 31 2e 31 2c 20 31 2e 32 teScale(1.1, 1.2
9120: 2c 20 31 2e 33 29 2c 20 0d 0a 20 20 20 20 20 20 , 1.3), ..
9130: 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20 20
9140: 20 20 20 20 20 20 20 20 20 20 20 41 54 4d 5f 43 ATM_C
9150: 72 65 61 74 65 54 72 61 6e 73 6c 61 74 65 28 31 reateTranslate(1
9160: 30 2c 20 32 30 2c 20 33 30 29 29 29 3b 0d 0a 0d 0, 20, 30)));...
9170: 0a 53 45 4c 45 43 54 20 41 54 4d 5f 52 6f 74 61 .SELECT ATM_Rota
9180: 74 65 28 0d 0a 20 20 20 20 20 20 20 20 20 20 41 te(.. A
9190: 54 4d 5f 53 63 61 6c 65 28 0d 0a 20 20 20 20 20 TM_Scale(..
91a0: 20 20 20 20 20 20 20 20 41 54 4d 5f 43 72 65 61 ATM_Crea
91b0: 74 65 54 72 61 6e 73 6c 61 74 65 28 31 30 2c 20 teTranslate(10,
91c0: 32 30 2c 20 33 30 29 2c 20 0d 0a 20 20 20 20 20 20, 30), ..
91d0: 20 20 20 20 20 31 2e 31 2c 20 31 2e 32 2c 20 31 1.1, 1.2, 1
91e0: 2e 33 29 2c 20 0d 0a 20 20 20 20 20 20 20 31 35 .3), .. 15
91f0: 29 3b 0d 0a 0d 0a 53 45 4c 45 43 54 20 41 54 4d );....SELECT ATM
9200: 5f 52 6f 74 61 74 65 28 0d 0a 20 20 20 20 20 20 _Rotate(..
9210: 20 20 20 20 41 54 4d 5f 53 63 61 6c 65 28 0d 0a ATM_Scale(..
9220: 20 20 20 20 20 20 20 20 20 20 20 20 20 41 54 4d ATM
9230: 5f 54 72 61 6e 73 6c 61 74 65 28 0d 0a 20 20 20 _Translate(..
9240: 20 20 20 20 20 20 20 20 20 20 20 20 20 41 54 4d ATM
9250: 5f 43 72 65 61 74 65 28 29 2c 20 0d 0a 20 20 20 _Create(), ..
9260: 20 20 20 20 20 20 20 20 20 20 31 30 2c 20 32 30 10, 20
9270: 2c 20 33 30 29 2c 0d 0a 20 20 20 20 20 20 20 20 , 30),..
9280: 20 20 31 2e 31 2c 20 31 2e 32 2c 20 31 2e 33 29 1.1, 1.2, 1.3)
9290: 2c 0d 0a 20 20 20 20 20 20 20 31 35 29 3b 0d 0a ,.. 15);..
92a0: 3c 2f 76 65 72 62 61 74 69 6d 3e 0d 0a 41 6c 6c </verbatim>..All
92b0: 20 74 68 72 65 65 20 73 74 61 74 65 6d 65 6e 74 three statement
92c0: 73 20 77 69 6c 6c 20 72 65 74 75 72 6e 20 65 78 s will return ex
92d0: 61 63 74 6c 79 20 74 68 65 20 73 61 6d 65 20 69 actly the same i
92e0: 64 65 6e 74 69 63 61 6c 20 41 66 66 69 6e 65 20 dentical Affine
92f0: 54 72 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 20 4d Transformation M
9300: 61 74 72 69 78 3b 20 61 6e 79 77 61 79 20 74 68 atrix; anyway th
9310: 65 20 73 65 63 6f 6e 64 20 6e 6f 74 61 74 69 6f e second notatio
9320: 6e 20 69 73 20 6f 62 76 69 6f 75 73 6c 79 20 6d n is obviously m
9330: 6f 73 74 20 63 6f 6e 63 69 73 65 20 61 6e 64 20 ost concise and
9340: 6d 6f 72 65 20 70 72 61 63 74 69 63 61 6c 20 74 more practical t
9350: 68 61 6e 20 74 68 65 20 6f 74 68 65 72 20 74 77 han the other tw
9360: 6f 2e 3c 62 72 3e 0d 0a 3c 75 3e 4e 6f 74 65 3c o.<br>..<u>Note<
9370: 2f 75 3e 3a 20 69 6e 20 61 6e 79 20 63 6f 6d 70 /u>: in any comp
9380: 6c 65 78 20 63 68 61 69 6e 20 6f 66 20 74 72 61 lex chain of tra
9390: 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 20 74 68 65 nsformations the
93a0: 20 3c 62 3e 69 6e 6e 65 72 6d 6f 73 74 3c 2f 62 <b>innermost</b
93b0: 3e 20 6f 70 65 72 61 74 69 6f 6e 20 77 69 6c 6c > operation will
93c0: 20 62 65 20 61 70 70 6c 69 65 64 20 3c 62 3e 66 be applied <b>f
93d0: 69 72 73 74 3c 2f 62 3e 2c 20 61 6e 64 20 74 68 irst</b>, and th
93e0: 65 20 3c 62 3e 6f 75 74 65 72 6d 6f 73 74 3c 2f e <b>outermost</
93f0: 62 3e 20 6f 70 65 72 61 74 69 6f 6e 20 77 69 6c b> operation wil
9400: 6c 20 62 65 20 61 70 70 6c 69 65 64 20 3c 62 3e l be applied <b>
9410: 6c 61 73 74 3c 2f 62 3e 2e 0d 0a 3c 2f 74 64 3e last</b>...</td>
9420: 3c 2f 74 72 3e 0d 0a 3c 74 61 62 6c 65 3e 3c 62 </tr>..<table><b
9430: 72 3e 3c 62 72 3e 0d 0a 3c 62 3e 4e 6f 74 65 3c r><br>..<b>Note<
9440: 2f 62 3e 3a 20 74 68 65 20 53 51 4c 20 69 6e 74 /b>: the SQL int
9450: 65 72 66 61 63 65 20 73 75 70 70 6f 72 74 69 6e erface supportin
9460: 67 20 41 66 66 69 6e 65 20 54 72 61 73 66 6f 72 g Affine Trasfor
9470: 6d 61 74 69 6f 6e 73 20 69 73 20 64 65 73 69 67 mations is desig
9480: 6e 65 64 20 69 6e 20 73 75 63 68 20 61 20 77 61 ned in such a wa
9490: 79 20 74 68 61 74 20 61 6e 79 20 63 6f 6d 70 6c y that any compl
94a0: 65 78 69 74 79 20 61 6e 64 20 64 69 66 66 69 63 exity and diffic
94b0: 75 6c 74 79 20 72 65 71 75 69 72 65 64 20 69 6e ulty required in
94c0: 20 6f 72 64 65 72 20 74 6f 20 64 69 72 65 63 74 order to direct
94d0: 6c 79 20 68 61 6e 64 6c 65 20 6d 61 74 72 69 63 ly handle matric
94e0: 69 61 6c 20 6f 70 65 72 61 74 69 6f 6e 73 20 69 ial operations i
94f0: 73 20 63 6f 6d 70 6c 65 74 65 6c 79 20 68 69 64 s completely hid
9500: 64 65 6e 2e 3c 62 72 3e 0d 0a 59 6f 75 20 61 72 den.<br>..You ar
9510: 65 20 73 69 6d 70 6c 79 20 72 65 71 75 69 72 65 e simply require
9520: 64 20 74 6f 20 63 68 61 69 6e 20 73 65 76 65 72 d to chain sever
9530: 61 6c 20 65 6c 65 6d 65 6e 74 61 72 79 20 74 72 al elementary tr
9540: 61 6e 73 66 6f 72 6d 61 74 69 6f 6e 73 2c 20 65 ansformations, e
9550: 61 63 68 20 6f 6e 65 20 6f 66 20 74 68 65 6d 20 ach one of them
9560: 62 61 73 69 63 61 6c 6c 79 20 73 69 6d 70 6c 65 basically simple
9570: 2c 20 69 6e 20 74 68 65 20 63 6f 72 72 65 63 74 , in the correct
9580: 20 73 65 71 75 65 6e 63 65 20 61 6e 64 20 74 68 sequence and th
9590: 61 74 27 73 20 61 62 73 6f 6c 75 74 65 6c 79 20 at's absolutely
95a0: 61 6c 6c 2e 3c 62 72 3e 0d 0a 3c 62 3e 41 54 4d all.<br>..<b>ATM
95b0: 3c 2f 62 3e 20 53 51 4c 20 66 75 6e 63 74 69 6f </b> SQL functio
95c0: 6e 73 20 77 69 6c 6c 20 3c 69 3e 3c 75 3e 6d 61 ns will <i><u>ma
95d0: 67 69 63 61 6c 6c 79 20 61 6e 64 20 73 69 6c 65 gically and sile
95e0: 6e 74 6c 79 3c 2f 75 3e 3c 2f 69 3e 20 6b 65 65 ntly</u></i> kee
95f0: 70 20 63 61 72 65 20 6f 66 20 61 6e 79 20 6d 61 p care of any ma
9600: 74 68 65 6d 61 74 69 63 61 6c 20 63 6f 6d 70 6c thematical compl
9610: 65 78 69 74 79 2e 3c 62 72 3e 3c 62 72 3e 20 20 exity.<br><br>
9620: 0d 0a 3c 68 72 3e 3c 62 72 3e 0d 0a 3c 61 20 68 ..<hr><br>..<a h
9630: 72 65 66 3d 22 68 74 74 70 73 3a 2f 2f 77 77 77 ref="https://www
9640: 2e 67 61 69 61 2d 67 69 73 2e 69 74 2f 66 6f 73 .gaia-gis.it/fos
9650: 73 69 6c 2f 6c 69 62 73 70 61 74 69 61 6c 69 74 sil/libspatialit
9660: 65 2f 77 69 6b 69 3f 6e 61 6d 65 3d 34 2e 32 2e e/wiki?name=4.2.
9670: 30 2d 64 6f 63 22 3e 62 61 63 6b 3c 2f 61 3e 0a 0-doc">back</a>.
9680: 5a 20 64 63 39 35 63 64 31 63 65 65 64 31 37 36 Z dc95cd1ceed176
9690: 38 32 30 63 63 65 64 66 38 35 32 30 66 65 38 62 820ccedf8520fe8b
96a0: 37 38 0a 78.