Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Comment on

( #3333=superdoc: print w/ replies, xml ) Need Help??

This has more to do with math than Perl, but there is a connection...

I'm trying to figure out an equation for scaling the dependency graphs on Stratopan such as the one seen here. I need to compute the inner and outer radius (in pixels) of the graph based on the number of nodes. As the number of nodes increases, the inner and outer radius need to be larger to accommodate them all.

Also, suppose I want to impose some boundaries. As the number of nodes approaches 200, the outer radius must asymptotically reach 600 to fit on a typical screen. At the same time, the inner radius must asymptotically reach about 200 (so the nodes are not too close together). Going in the other direction, The outer radius must not get any smaller than about 300 and the inner radius must not get any smaller than about 100. There could be 1 or 1000 nodes, but the dimensions must stay within those boundaries.

So that is the basic problem. I looked into using a logarithm, but it has been a long time since I sat in a math class so I couldn't figure out how to apply them. I can figure out how to tune the constants if you can point me in the right direction.

Thanks for your time.

-Jeff


In reply to Seeking A Scaling Equation by jthalhammer

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • Outside of code tags, you may need to use entities for some characters:
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others chilling in the Monastery: (10)
    As of 2014-08-20 15:49 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?

      The best computer themed movie is:











      Results (118 votes), past polls