Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project!

## inkscape-devel

 [Inkscape-devel] Matrix multiplication reversed? From: Jasper van de Gronde - 2008-03-17 16:34:39 ```I am attempting to eliminate some redundant types, at the moment I have just tried eliminating NRPoint and NRMatrix in favour of NR::Point and NR::Matrix (patch available soon, I'm currently double-checking it). While looking at the matrix multiplication as defined in nr-matrix.cpp it looks like the definition is reversed (compared to the usualy mathematical definition). That is: A*B=BA ... The reason I think it is reversed is simply that if C=A*B (with C, A and B NR::Matrix's), then C[0] is the dot product between the first column of A and the first row of B (and similarly for the other elements). Am I missing something or is it indeed reversed? And if it is, is there a reason for this? ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: J.B.C.E - 2008-03-17 17:05:44 ```> -----Original Message----- > From: inkscape-devel-bounces@... > [mailto:inkscape-devel-bounces@...] On > Behalf Of Jasper van de Gronde > Sent: maandag 17 maart 2008 16:26 > To: inkscape > Subject: [Inkscape-devel] Matrix multiplication reversed? > > I am attempting to eliminate some redundant types, at the > moment I have just tried eliminating NRPoint and NRMatrix in > favour of NR::Point and NR::Matrix (patch available soon, I'm > currently double-checking it). Although I can't help you now on the reversal issue, I want to place a comment: Why not eliminate them in favor of 2Geom's points and matrices ? Is the change NRPoint => NR::Point so tiny? Regards, Johan ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: MenTaLguY - 2008-03-17 17:11:44 ```On Mon, 17 Mar 2008 18:05:51 +0100, J.B.C.Engelen@... wrote: > Although I can't help you now on the reversal issue, I want to place a > comment: > Why not eliminate them in favor of 2Geom's points and matrices ? Is the > change NRPoint => NR::Point so tiny? That appears to be what he's doing. -mental ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: J.B.C.E - 2008-03-17 17:17:26 ```> -----Original Message----- > From: MenTaLguY [mailto:mental@...] > Sent: maandag 17 maart 2008 18:12 > To: Engelen, J.B.C. (Johan) > Cc: th.v.d.gronde@...; inkscape-devel@... > Subject: Re: [Inkscape-devel] Matrix multiplication reversed? > > On Mon, 17 Mar 2008 18:05:51 +0100, > J.B.C.Engelen@... wrote: > > Although I can't help you now on the reversal issue, I want > to place a > > comment: > > Why not eliminate them in favor of 2Geom's points and matrices ? Is > > the change NRPoint => NR::Point so tiny? > > That appears to be what he's doing. I'm sorry, I'm confused by your comment mental. What were you referring to? I meant "is the change NRPoint => NR::Point so tiny, that it is very easy etc etc and to 2geom would be more difficult so will just convert to NR::Point" ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: Jasper van de Gronde - 2008-03-17 18:15:37 ```J.B.C.Engelen@... wrote: >> -----Original Message----- >> From: MenTaLguY [mailto:mental@...] >> ... >> On Mon, 17 Mar 2008 18:05:51 +0100, >> J.B.C.Engelen@... wrote: >>> Although I can't help you now on the reversal issue, I want >> to place a >>> comment: >>> Why not eliminate them in favor of 2Geom's points and matrices ? Is >>> the change NRPoint => NR::Point so tiny? >> That appears to be what he's doing. > > I'm sorry, I'm confused by your comment mental. What were you referring to? > I meant "is the change NRPoint => NR::Point so tiny, that it is very easy etc etc and to 2geom would be more difficult so will just convert to NR::Point" More like the other way around, NR::Point => Geom::Point (and similarly for Matrix and friends) shouldn't be that hard (they're very, very similar), but I thought I'd first eliminate the old NR structures. ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: J.B.C.E - 2008-03-17 18:53:44 ```> -----Original Message----- > From: inkscape-devel-bounces@... > [mailto:inkscape-devel-bounces@...] On > Behalf Of Jasper van de Gronde > Sent: maandag 17 maart 2008 19:16 > To: Engelen, J.B.C. (Johan) > Cc: inkscape-devel@...; mental@... > Subject: Re: [Inkscape-devel] Matrix multiplication reversed? > > J.B.C.Engelen@... wrote: > >> -----Original Message----- > >> From: MenTaLguY [mailto:mental@...] ... > >> On Mon, 17 Mar 2008 18:05:51 +0100, > >> J.B.C.Engelen@... wrote: > >>> Although I can't help you now on the reversal issue, I want > >> to place a > >>> comment: > >>> Why not eliminate them in favor of 2Geom's points and > matrices ? Is > >>> the change NRPoint => NR::Point so tiny? > >> That appears to be what he's doing. > > > > I'm sorry, I'm confused by your comment mental. What were > you referring to? > > I meant "is the change NRPoint => NR::Point so tiny, that > it is very easy etc etc and to 2geom would be more difficult > so will just convert to NR::Point" > > More like the other way around, NR::Point => Geom::Point (and > similarly for Matrix and friends) shouldn't be that hard > (they're very, very similar), but I thought I'd first > eliminate the old NR structures. Yes I know, that's why I was wondering why you'd go via NR::Point and not just directly :). I'd like to convert things to 2geom for gsoc this year. Probably you've seen my NR::Point::to_2geom() method and friends? The matrix reversal is a good find though. Did you have a look how 2geom does it? Thanks, Groeten! :-) Johan ```
 Re: [Inkscape-devel] Matrix multiplication reversed? From: Jasper van de Gronde - 2008-03-17 19:46:05 ```J.B.C.Engelen@... wrote: >> ... >> More like the other way around, NR::Point => Geom::Point (and >> similarly for Matrix and friends) shouldn't be that hard >> (they're very, very similar), but I thought I'd first >> eliminate the old NR structures. > > Yes I know, that's why I was wondering why you'd go via NR::Point > and not just directly :). I'd like to convert things to 2geom for > gsoc this year. Probably you've seen my NR::Point::to_2geom() method and friends? Definitely, but since I probably won't have a lot of time for the rest of this week I'll post a patch for this change first (as soon as I've double-checked the last few changes). One of the reasons to attack this first was that some things were implemented two, or even three, times in the same set of libnr files alone! > The matrix reversal is a good find though. Did you have a look how 2geom does it? Yes, it does it in exactly the same way, and so do the optimized matrix multiplications for NR::translate, NR::scale and NR::rotate. I have not checked what Cairo does. (BTW, I just read in njh's mail that there probably indeed was a good reason to do this.) ```