Quickreference: display elements in a circle

How to display elements in a circle? A small function to do that is:


GeSHi Error: GeSHi could not find the language actionscript3 (using path /nfs/c03/h01/mnt/85630/domains/nightdrops.com/html/wp-content/plugins/snipplr/geshi/geshi/) (code 2)

Parameters are:

  • items: the items to be displayed a a circle
  • center: the center of the circle
  • distance: the distance from the center
  • initialAngle: the angle of the first item. Zero means that the item wil be aligned orizontally with the center, on his right.

Here’s an example:

Graph examples

I’ve always been fascinated by networks, and everything that can be modeled as a graph. In some spare time one I’ve tried to model a simple graph structure in actionscript 3 that can be implemented to render some nice example. I want to extend it by adding some graph algorhythm like Breadth-first search, Depth-first seach, Dijkstra and others, just to keep mind busy in the summer, since in 3 days from now i’ll be officially unemployed.

So the first example consists in a bunch of nodes connected.. uhhu! Nodes can be activated, and each time this happens to a node, there is a chance that he activates his neighbours.

If you want to see the code, there are two steps: I’ve stored the code that models the network (the Graph class and the INode interface) in a simple framework of mine that you can checkout from here; then you can download the project as a zip file from this link)

As a references, you should see Levitated examples on networks, starting by this one or  by this one.