From: Andre Wobst <wobsta@us...>  20040727 12:10:43

Hi, On 27.07.04, Magnus Lie Hetland wrote: > > > Equal(b, a + Point(10, 0)) > > > > I just couldn't resist: A linear equation solver can be easily build > > like this. > > I know  I've thought about this myself in the past, and I've even > found code that does this sort of thing. I don't remember exactly > where, but it had a variable class and did all the linear equations > behind the scenes. > > Also, numarray (and Numeric) has support for the equation solving > part; I guess they could be optional mechanisms for speed, if this is > indeed the way to go. BTW: I didn't wrote a linear equation solver, but what I did was exactly a "variable class" and the "linear equations behind the scenes", i.e. building up linear terms. To actually solve the linear equations I used Numeric in my sample code already. > Certainly. It would also be neat to be able to use parametrized curves > in the same system, as in MetaPost; but I guess it's not quite that > critical, as you already have support for finding intersections > in PyX. Finding intersections etc. is usually a nonlinear operation. But you can define points by that ... sure. I guess it will be similar to MetaPost in that respect (though I'm not quite sure right now). > > My grasp tells me, that a transformation contains another set of > > variables (6 for a 2d>2d affine transformation). When multiplying > > with a (lazy) point (two variables) the system becomes nonlinear. > > I'm kind of confused at the moment ... ;) > > Hm. No, I don't think so... If you say that one point, transformed by > an affine transform, equals another point, all you have is a linear > set of two equations in two variables  no? Say p and p' are (2d) points, and t is a transformation (i.e. a 2x2 matrix + a 2d vector). Then you can write p' = t(p) Once you say p' and p are lazy vectors (i.e. they contain 2 variables) as well as t is a lazy transformation (i.e. it contain 6 variables), than the equation above is nonlinear. There are nonlinear terms in matrix times vector when they both contain variables. So I think what one has to do is to postpone this nonlinear equation until the nonlinear terms are solved by other constraints. I guess, thats what MetaPost does as well ... as soon as p or t gets defined somewhere else, the equation above becomes linear. > Anyway, writing a system like this based on linear equations is a bit > more work than a oneway functionbased one. I'll have a look but I > can't promise anything. Sure, nobody does. But we might have a starting point now ... and maybe somebody is really interested in this. Its not top priority for me, but well, on the other hand, I already like it ... we can get something really funny quite quickly I guess. André  by _ _ _ Dr. André Wobst / \ \ / ) wobsta@..., http://www.wobsta.de/ / _ \ \/\/ / PyX  High quality PostScript figures with Python & TeX (_/ \_)_/\_/ visit http://pyx.sourceforge.net/ 