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

Member Avatar for iamthwee

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.

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.

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

why dont you use sine & cosine relations as

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.