954,510 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Drawing a circle of lines

Hi,

I want to do that i have a fixed center point in a frame. when i enter raduis in textbox and click replot button, i want that lines are drawn originating from that center point in such a way that their end points form a circle. (As children draw sun in drawings) But the end of lines are 1 degree apart.

Regards

anti_genius
Light Poster
27 posts since Nov 2006
Reputation Points: 10
Solved Threads: 0
 
Hi, I want to do that i have a fixed center point in a frame. when i enter raduis in textbox and click replot button, i want that lines are drawn originating from that center point in such a way that their end points form a circle. (As children draw sun in drawings) But the end of lines are 1 degree apart. Regards


Can you upload a picture to explain better.

iamthwee
Posting Expert
5,950 posts since Aug 2005
Reputation Points: 1,543
Solved Threads: 439
 

There is no such thing as "the ends are one degree apart" in mathematics.

You probably mean you want to draw lines at angles offset from each other by one degree and originating all at the same point.

Nothing hard about that, just look at the line drawing methods and with a bit of trig you should be able to figure out how to do it.

jwenting
duckman
Team Colleague
8,392 posts since Nov 2004
Reputation Points: 1,662
Solved Threads: 337
 

here's some pseudo-basic code.

cx,cy = center of circle

for a = 1 to 360 step 2
    x = sin(a)*radius
    y = cos(a)*radius
    line cx,cy,x,y
next a
Phaelax
Practically a Posting Shark
858 posts since Mar 2004
Reputation Points: 92
Solved Threads: 51
 

why dont you use sine & cosine relations as

s_khardenavis
Newbie Poster
3 posts since Dec 2006
Reputation Points: 10
Solved Threads: 0
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You