• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
  • paul wheaton
Sheriffs:
  • Ron McLeod
  • Devaka Cooray
  • Henry Wong
Saloon Keepers:
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Tim Moores
  • Mikalai Zaikin
Bartenders:
  • Frits Walraven

Drawing Problem

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am trying to solve a graphics problem. I need an algorithm for drawing an image made up of a large circle (100 pixel diameter) in the middle
and around this circle, there should be smaller (25 pixel diameter) circles. there should be a 5 pixel separation between the large circle and the orbiting circles.
The problem I am grappling with is that the outer circles need to be set at equal distances around the the circle at the center, and the number of orbiting
circles is not fixed and can be varied, hence varying the separation of the outer circles, and to be honest, I have
absolutely no idea on how to go about this. All I can do is draw basic shapes.
Any help would be appreciated.
Please pardon this long winded narrative.

-Stanley
 
Ranch Hand
Posts: 357
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ok so the big circle is 100 pixel diameter and the orbiting ones should be 25 of diameter and a 5 pixels separation which leads that the orbiting circles should be placed on the circumference of a helping circle (lets named it X-circle) of a radius of 100/2 + 25/2 + 5 = 67.5 and concentric with the 100 pixel circle.


now you know where to place the orbits, but you need to put them at equal distances between each others to do this you need to make the following calculation where "n" is the number of orbiting circuits required. you could use the following pseudocode




if you try it on a piece of paper by hand you will get a clear idea, have fun with that
 
Rancher
Posts: 3324
32
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Cross posted: http://forums.sun.com/thread.jspa?messageID=10802316
 
Marshal
Posts: 79969
396
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Rob Camick wrote:Cross posted: . . .

Thank you for noticing.

Stanley Gulavi Please read this.
 
Stanley Gulavi
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks guys. I have gotten it to work.
And sorry about the cross-posting. Won't happen again.
 
I think she's lovely. It's this tiny ad that called her crazy:
Gift giving made easy with the permaculture playing cards
https://coderanch.com/t/777758/Gift-giving-easy-permaculture-playing
reply
    Bookmark Topic Watch Topic
  • New Topic