[prev in list] [next in list] [prev in thread] [next in thread] 

List:       koffice
Subject:    Re: Polar coordinate system support in KDiagram
From:       Stefan Preble <sfp2322 () ritvax ! isc ! rit ! edu>
Date:       1999-09-22 1:44:30
[Download RAW message or body]

I'm not totally sure what kdiagram is trying to accomplish but if you were
to implement polar coordinates you might want to take it a step further and
move to spherical and cylindrical coordinates. (Spherical is a tad more
complex and all cylindrical is is polar with one more variable z.. but z
always equals z so it's fairly easy to implement :)

Just a consideration for future expandability..

If you have any questions on cylindrical or spherical coordinates just let
me know :)

Here's a quick reference.

Cylindrical (NOTE a = theta.. We'red they put the theta key on these
keyboards?! :):
x=r*cos(a)
y=r*sin(a)
z=z

Spherical (There's another variable phi.. or however you're supposed to
spell it.. just think of a sphere):
x=p*cos(a)sin(b)
y=p*sin(a)sin(b)
z=p*cos(b)

Hope that helps without confusing you too much..

Stefan F. Preble




----- Original Message -----
From: Joel Sing <jsing@river.net.au>
To: <koffice@master.kde.org>
Sent: Tuesday, September 21, 1999 10:57 PM
Subject: Re: Polar coordinate system support in KDiagram


> Hi Lotzi,
>
> Lotzi Boloni wrote:
>
> > > now, when KDiagramm development started again, can we expect polar
coordinate
> > > system support ?
> > >
> > > AFAIK even MS Excel doesn't have this feature, which is very usefull
sometimes.
> >
> >   What exactly polar coordinate system support means in this case? Can
you
> > give some example?
>
> Instead of giving X and Y coordinates (cartesian or rectangular coordinate
> system) you specify an angle (theta) and a radius (r). This is far better
explained
> on paper :). As an example, in 2D space you give 2,2 in cartesian and
PI/4, 2.829 in
> polar (angle of PI/4 and radius of ~2.829. The following formulae allow
you to
> convert between coordinate systems:
>
>     y = r cos(theta)
>     x = r sin(theta)
>
>     theta = ?? Can't remember this one - if you need it let me know :)
>     r = sqrt(y^2 + x^2)
>
> Polar is extremely useful for drawing circular patterns especially
circles, and are
> used extensively in computer graphics. For example the following can be
used to draw
> the outline of a circle in rectangular coordinates with radius of 2:
>
> inc=48;
> radius = 2;
> for(n = 0; n < inc*2; n++){
>     theta += PI/inc;
>     putpixel(radius*cos(theta), radius*sin(theta));
> }
>
> Obviously the more intervals used the more accurate it will be.
>
> If you need more info let me know and I'll see what I can chase up for
you. I have a
> collection of maths texts which explain it fairly throughly! ;-)
>
> Cheers,
>
> Joel
>

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic