Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


Circular sector plotting

 
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map)
Author Message
feathers1664



Joined: 30 Oct 2007
Posts: 9
Location: United Kingdom

PostPosted: Fri Mar 28, 2008 12:14 pm    Post subject: Circular sector plotting Reply with quote

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

PostPosted: Fri Mar 28, 2008 1:13 pm    Post subject: Re: Circular sector plotting Reply with quote

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
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Plugin: (Network Weather Map) All times are GMT - 5 Hours
Page 1 of 1

 



Powered by phpBB © 2001, 2005 phpBB Group