|
-
Oct 14th, 2000, 12:04 PM
#1
Thread Starter
Frenzied Member
How can I make a line spin around its own center???
-
Oct 14th, 2000, 12:25 PM
#2
transcendental analytic
Code:
Private Sub Form_Activate()
Dim centerx&, centery&, radius&, angle!
centerx = (Line1.X1 + Line1.X2) / 2
centery = (Line1.Y1 + Line1.Y2) / 2
radius = Sqr((Line1.Y1 - Line1.Y2) ^ 2 + (Line1.X1 - Line1.X2) ^ 2) / 2
Do
angle = angle + 0.01
Line1.X1 = centerx + Cos(angle) * radius
Line1.X2 = centerx + Cos(angle + 3.1415) * radius
Line1.Y1 = centery + Sin(angle) * radius
Line1.Y2 = centery + Sin(angle + 3.1415) * radius
DoEvents
If angle > 6.283 Then angle = angle - 6.283
caption = angle
Loop While Forms.Count
End Sub
Put this on the form with a line, and run!
Use  
writing software in C++ is like driving rivets into steel beam with a toothpick.
writing haskell makes your life easier:
reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.
-
Oct 14th, 2000, 12:28 PM
#3
Thread Starter
Frenzied Member
Thanks you very much! Thats just what I was looking for!!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|