Archived

This topic is now archived and is closed to further replies.

Spinning Line!!

This topic is 6251 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

Recommended Posts

Can some one plz explain to me how to make a simple line spin in visual basic? I''ve been looking for a way for days now, and am coming up empty handed! If someone write the code that would be a little better.. thx

Share on other sites
Well, I don''t know how to do it in Visual Basic, but, regardless, it''ll take a little Trig.

Basically, you''ll want to have 2 variables: Degree of Line (between 0 and 360) and Radius of circle(the length of the line).

Then, what you''ll do is this:
You have an X,Y which is center of your circle, and Radius.

You basically loop through, incrementing the degree of the angle, then figure out where the end of the line is and draw it
ie:

DrawLine(X, Y, X + Xlength, Y + Ylength);

to get radians, you take the degrees and multiply by Pi/180

Hope that helps some.

1. 1
Rutin
46
2. 2
3. 3
4. 4
5. 5

• 12
• 10
• 12
• 10
• 13
• Forum Statistics

• Total Topics
632991
• Total Posts
3009750
• Who's Online (See full list)

There are no registered users currently online

×