Darxus on Wed, 8 May 2002 01:20:12 +0200


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

[PLUG] math help for this graphing program I'm writing to graph the keyring ?


I think it is rediculous that, by far, the most difficult part of
writing this graphing program to replace neato for doing keyring graphs
is calculating the location of the little freaking arrowheads.

http://www.chaosreigns.com/code/springgraph/diagram.jpg

The axes of the ellipse are paralel to the coordinate axes.

I know the x,y coordinates of the center of the ellipse.  

I know the height and width of the ellipse.

I know angle A (it can be anything)

I am trying to find either the length of line B (radius of the ellipse
at the given angle), or the x,y coordinates of the intersection of line
B with the edge of the ellipse (from this I can easily calculate the length).


Current rendering of the plug keyring with springraph, with nodes as
circles:
http://www.chaosreigns.com/code/springgraph/phillylinux_circles.png

Current rendering with ellipses (and arrows still aligned for circles):
http://www.chaosreigns.com/code/springgraph/phillylinux_ellipses.png

I am interested in your opinions of these graphs, compaired to
http://www.phillylinux.org/keys/phillylinux.jpg


Ian suggested finding the coordinates of the two foci, using the line
between them as a base of a triangle, and the intersection of line B
with the edge of the ellipse as the opposite point of the triangle.

I think there's some useful info here:
http://mathforum.org/dr.math/problems/crosbie8.9.98.html


The program is written in perl, and can be found in the same directory as
the springgraph images (http://www.chaosreigns.com/code/springgraph/).
More creative suggestions, such as libraries which may be able to calculate
these values (even possibly rendering to postscript instead of png in the
process) are quite welcome.

-- 
"Am I a man who dreamed I was a butterfly, or am I a butterfly who is
dreaming I am a man?" - Chuang Tsu, ~350 BC
http://www.ChaosReigns.com

Attachment: pgphZ2JRzpylk.pgp
Description: PGP signature