|
|
| Author |
Message |
feathers1664
Joined: 30 Oct 2007 Posts: 9 Location: United Kingdom
|
Posted: Fri Mar 28, 2008 12:14 pm Post subject: Circular sector plotting |
|
|
I want to graph multiple nodes in a circular fashion to a central point. I would ideally like them to be equally placed.
Does anyone know of a way of calculating the circumference points if you specify the sector count?
Ie. A circle with just 4 sectors would have lines at 0,90,180 and 270 degrees. How can work out the x,y position of these plots on a circumference given the circle radius?
I've seen an example map by Tybio but I think he uses a script to generate his.
Many thanks! |
|
| Back to top |
|
 |
Howie Cacti Guru User
Joined: 16 Sep 2004 Posts: 1958 Location: United Kingdom
|
Posted: Fri Mar 28, 2008 1:13 pm Post subject: Re: Circular sector plotting |
|
|
| feathers1664 wrote: | I want to graph multiple nodes in a circular fashion to a central point. I would ideally like them to be equally placed.
Does anyone know of a way of calculating the circumference points if you specify the sector count?
Ie. A circle with just 4 sectors would have lines at 0,90,180 and 270 degrees. How can work out the x,y position of these plots on a circumference given the circle radius?
I've seen an example map by Tybio but I think he uses a script to generate his.
Many thanks! |
| Code: |
angle= (360/number-of-things) * number-of-this-thing
X = center_x + distance*cos(angle)
Y = center_y - distance*sin(angle)
|
I think I remembered my high-school trig OK there... |
|
| Back to top |
|
 |
|