Re: Matrix Multiplication bug and workaround
On 07/30/2017 04:42 PM, hh via use-livecode wrote: Let me explain that a bit simpler for readers who don't know or forgot linear/matrix algebra. Thanks. That does make sense, and I did indeed need a refresher course. -- Mark Wieder ahsoftw...@gmail.com ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Matrix Multiplication bug and workaround
I noticed the announcement of your conference in Livecode website: https://livecode.com/global/hermann-hoch/ Have you checked Jim Hurley stacks? http://jamesphurley.com/Revolution.html Al > These were the first two minutes of my talk > at LC Global in Nov 2017.Now I can start after that, > describing how to find that single set, without > matrix algebra ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Matrix Multiplication bug and workaround
Hi Al. Yes. I saw this mistake several times. The misleading thing is, TMHO, the name "transformation matrix" for [a,b,c,d,e,f] (because the listing is pairwise for columns, as you now describe, and not for rows). Let me explain that a bit simpler for readers who don't know or forgot linear/matrix algebra. It would be better to name it, what it is, a "transformation list". [a,b,c,d,e,f] lists the factors [a,b,c,d] and the summands [e,f] that define the "affine transformation" of a point (x_old,y_old) to a point (x_new,y_new): x_new = a*x_old + c*y_old + e y_new = b*x_old + d*y_old + f [a,d] are the scaling factors for (x_old,y_old), [b,c] are the shearing factors for (x_old,y_old), [e,f] are the translation summands for (x_old,y_old). So [1,0,0,1,0,0] defines the identity: x_new = x_old and y_new = y_old. Every scaling, shearing, translation or rotation of a point (x_old,y_old) can be built by ONE single set of such a list [a,b,c,d,e,f]. Hermann p.s. These were the first two minutes of my talk at LC Global in Nov 2017. Now I can start after that, describing how to find that single set, without matrix algebra ;-) ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Matrix Multiplication bug and workaround
Hi Hermann, Hermann wrote: > This is not a bug, your script is wrong. > If TM is a,b,c,d,e,f then you have to d > put item 1 of pArgs into tMatrix[0,0] > put item 2 of pArgs into tMatrix[1,0] > put item 3 of pArgs into tMatrix[0,1] > put item 4 of pArgs into tMatrix[1,1] > this yields correct results. > [In fact your 'workaround' corrects the wrong script part] Now I understand: This transformation matrix: 1,0.6,-1.2,1,40,10 should be stored like this: [0,0] [0,1] [0,2] a c e 1-1.2 40 [1,0] [1,1] [1,2] b d f 0.6 1 10 [2,0] [2,1] [2,2] 0 0 1 I will delete my bug report. Thanks again Hermann for taking a close look at this. Have a nice week! Al ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Matrix Multiplication bug and workaround
Al, your script is wrong. You are building the matrix in a wrong way. It is no bug! With your 'workaround' you point yourself to the lines where you did make the mistake. http://lists.runrev.com/pipermail/use-livecode/2017-July/240074.html ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode
Re: Matrix Multiplication bug and workaround
Hi Al. This is not a bug, your script is wrong. If TM is a,b,c,d,e,f then you have to do put item 1 of pArgs into tMatrix[0,0] put item 2 of pArgs into tMatrix[1,0] put item 3 of pArgs into tMatrix[0,1] put item 4 of pArgs into tMatrix[1,1] this yields correct results. [In fact your 'workaround' corrects the wrong script part] Hermann ___ use-livecode mailing list use-livecode@lists.runrev.com Please visit this url to subscribe, unsubscribe and manage your subscription preferences: http://lists.runrev.com/mailman/listinfo/use-livecode