Greetings again,
I have asked this question wrong - and indeed, was somewhat harsh to the first reply.
You are quite right - this is, technically, not a perl question per se - but since this code will be implemented in perl, I hoped it would be close enough that I would be able to arouse the brains of others into helping me with this conundrum

I felt that the question posed showed enough complexity that a very simple "How to use foreach" was clearly not what I wanted in an answer thus the short, sharp nature of my reply.
HOWEVER in saying that, the fact that jhanna gave me an explanation that quite possibly a number of monks would say 'What a moron, go read a book' is a good thing.
So, thanks jhanna, my apologies for being short - but that wasn't quite the answer I was looking for.

I'm going to restate my question like I should have in the first place. The possibly misleading manner I asked it in was how the simulation was explained to me:
I was playing around with making my own IP map. Nothing large, just my local network for a laugh and to show off. The nodes are the IP addresses, the links are the routes between them.
You do multiple traceroutes, from multiple locations to create an interlinked "map" (Which I have neatly stored in a MySQL DB). The "distance" between nodes is calculated from the average "distance", in milliseconds, from IP addresses in the traceroute.
The links are like springs, their repulsion charge is the given distance, and when set going in the simulation, the nodes will push each other apart in such a way that they place themselves roughly in space to equate the "distances" from other IP addresses...
I want all the co-ordinates, after the simulation has run and spaced them accordingly, to dump into POVray.

I hope this is more clear,
JP,
-- Alexander Widdlemouse undid his bellybutton and his bum dropped off --


In reply to Re: Re: 3 Dimensional repelling particle simulation by JPaul
in thread 3 Dimensional repelling particle simulation by JPaul

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!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • 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, details, 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, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            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.