Re: XForms: hoe to display information nodes in cone shape

Steve Lamont (spl@szechuan.ucsd.edu)
Sun, 22 Feb 98 12:36:35 PST

# To subscribers of the xforms list from spl@szechuan.ucsd.edu (Steve Lamont) :

> I have a question on how to display a structure of a information tree in
> a cone shape. However, my code doesn't seem to work correctly. I have
> tried to solve for a few days without success. Is there some algorithm
> to calculate the position of the nodes (a,b,c,d,a1,....). If so, please
> show me the direction. Thanks.

Bearing in mind that this isn't an XForms question and that it really
doesn't belong on this list, you should consider using a
parameterized form of the equation of the ellipse:

x = x0 + ( a * cos( 2 Pi * t ) )
y = y0 + ( b * sin( 2 Pi * t ) )

where x0 and y0 are the origin of the ellipse, a and b are the one
half the length of the major and minor axes of the ellipse, and t is
the independent variable.

Of course, if you blindly use this pair of equations, things may tend
to "bunch up" at the ends of the major axis. Thus, you may want to
space things out evenly along the perimeter. The approximate formula
for the perimeter is

p = 2 Pi sqrt( ( a^2 + b^2 ) / 2 )

[the exact solution involves fiddling with elliptic integrals].

I believe that armed with this information, you should be able to
derive a suitable function.

For more information, consult your favorite text on Analytic Geometry
or a good math handbook, such as the CRC Standard Mathematical Tables,
which should be within easy grasp of anyone engaged in any form of
computer graphics (both physically and metaphorically).

spl
_________________________________________________
To unsubscribe, send the message "unsubscribe" to
xforms-request@bob.usuf2.usuhs.mil or see
http://bob.usuf2.usuhs.mil/mailserv/xforms.html
XForms Home Page: http://bloch.phys.uwm.edu/xforms
List Archive: http://bob.usuf2.usuhs.mil/mailserv/list-archives/