[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Plotting TODO
On Fri, 11 Feb 2000, Nils Barth wrote:
> Thus spake Aaron Lehmann:
> > I looked at this dir, some plots look pretty hard. However, if you can
> > compute vector fields, I can draw them into a drawing area fairly easily
> > :).
>
> hehe -- well, you wanted a challenge, eh?
> re: vector fields.
> computing them is trivial:
> given two functions (the x-component and the y-component):
> (f(x,y),g(x,y)), just evaluate f and g at a bunch of points.
> For example, if f(x,y)=sin(x), g(x,y)=cos(x*y), to plot the vector
> field, just choose a bunch of points
> (say, (0,0), (1,0), (2,0), ... (5,0), (0,1), ... (5,1), ... (0,2)
> .. (5,2), ... (5,5))
> and then at the point (x,y), put the vector (f(x,y),g(x,y))
>
> Is this what you're looking for w/r/t `computing vector fields'?
I think I understand. But a vector has a magnitude component and a
direction component, how do i find the direction?
> The other concerns with plotting vector fields are the assorted
> scaling options (this is easy to add in later -- for instance, you
> might ask to scale all vectors by a factor of 1/2 so they don't crash
> into each other or something), and rotated arrowheads (which is a bit
> harder, but should be easy with any library that offers affine
> transforms -- what's the GNOME replacement for Imlib?)
Sounds important. GdkPixbuf is catching on as an Imlib replacement, but
implementing a vector field as a canvas item and using libart for affine
transforms seems like the most sensible idea for now.
> --
> -nils
>