websiterepairguys Posted December 3, 2007 Share Posted December 3, 2007 I'm not using the right terminology here, but what I am trying to do is create an image, say 1024x768, with an icon that represents a page in the middle. Then, it will have other icons that surround it in a circular fashion. These icons will be linked by a line indicating a relationship. If you've ever used frontpage to view the link map of a site you would know what I'm referring to. I'm at a disadvantage because of the math. Basically, I know I need to: calculate center point (easy) calculate radius (easy) draw circle (easy) calculate points along the circle's circumference (hard) draw icons centered on these points (medium) draw lines connecting points to center (easy) draw text midway between along this line indicating what the line represents (not so easy) Any help? Thanks Quote Link to comment Share on other sites More sharing options...
Barand Posted December 3, 2007 Share Posted December 3, 2007 Here's the "hard" one Given a circle of radius $r centred at ($cx, $cy) then a point ($x, $y) on its circunference at angle $a degrees is given by $x = $cx + $r * cos (deg2rad($a)); $y = $cy + $r * sin (deg2rad($a)); Quote Link to comment Share on other sites More sharing options...
Wes1890 Posted December 3, 2007 Share Posted December 3, 2007 idk calculate center point (easy) calculate radius (easy) draw circle (easy) i assume you have these since you put "easy" calculate points along the circle's circumference (hard) are you having 6 points? just divide 360 (degrees) by 6 (points) then, you know the coordinates of each point: point1 = $centerx - 0, $centery - 60; point2 = $centerx + 60/2, $centery - 60/2; point3 = $centerx + 60, $centery + 0; etc. etc. etc. draw icons centered on these points (medium) if you get the points then it should be no problem draw lines connecting points to center (easy) you got it draw text midway between along this line indicating what the line represents (not so easy) divide the x/y of the point by 2 (from the center), put the text there thats all i can ponder up.. idk if i even understand you right so if im way off then my bad lol Quote Link to comment Share on other sites More sharing options...
Barand Posted December 3, 2007 Share Posted December 3, 2007 calculate points along the circle's circumference (hard) are you having 6 points? just divide 360 (degrees) by 6 (points) then, you know the coordinates of each point: point1 = $centerx - 0, $centery - 60; point2 = $centerx + 60/2, $centery - 60/2; point3 = $centerx + 60, $centery + 0; etc. etc. etc. Please tell me you aren't developing any life-critical applications draw text midway between along this line indicating what the line represents (not so easy) divide the x/y of the point by 2 (from the center), put the text there That will find the mid point of the line but takes no account of the length of the text or its angular rotation Quote Link to comment Share on other sites More sharing options...
Wes1890 Posted December 3, 2007 Share Posted December 3, 2007 ^ lmao draw text midway between along this line indicating what the line represents (not so easy) divide the x/y of the point by 2 (from the center), put the text there That will find the mid point of the line but takes no account of the length of the text or its angular rotation i didnt think about angles, i was just figuring mid points.. and yes, that would work if you know the center's x/y and the points x/y.. if the center x/y is 0/0 and the point x/y is 50/50 (down and right) dividing 50/2(x) and 50/2 (y) would get a midpoint between the center and outer point Quote Link to comment Share on other sites More sharing options...
Barand Posted December 3, 2007 Share Posted December 3, 2007 That will give a start point for the text if it is zero length. To centre on that midpoint the text needs to start half its length to the left (ignoring rotation) Quote Link to comment Share on other sites More sharing options...
websiterepairguys Posted December 3, 2007 Author Share Posted December 3, 2007 Here is an example I just made in Gimp Quote Link to comment Share on other sites More sharing options...
websiterepairguys Posted December 3, 2007 Author Share Posted December 3, 2007 Actually Come to think of it, i think this would make a damn fine Flash app for my project. Use flash/ajax to pull data from server as they click on the nodes, it repains the picture. This is a fictitious example. The project I'm working on is much more interesting then this example. Any flash gurus out here? [wrong board maybe but i'd be using PHP to feed the flash app so its not completely off topic ] Quote Link to comment Share on other sites More sharing options...
Barand Posted December 3, 2007 Share Posted December 3, 2007 That is nothing like you described in your initial post. No icons Not on a circle No text midway between center and icon. I'm out. Quote Link to comment Share on other sites More sharing options...
websiterepairguys Posted December 3, 2007 Author Share Posted December 3, 2007 I'm not a graphics artist. They are roughly in a circle. The blue boxes *are* the icons Gimp sucks. I found this too: http://www.maani.us/charts/index.php Thanks for your help Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.