|
-
Jul 26th, 2001, 01:18 PM
#1
Thread Starter
Addicted Member
-
Jul 26th, 2001, 01:41 PM
#2
Good Ol' Platypus
Not too sure, but I think your problem lies in your DtoR function. I believe it should be:
DtoR = degrees / (180 / pi)
Once again, not too sure.
All contents of the above post that aren't somebody elses are mine, not the property of some media corporation. 
(Just a heads-up)
-
Jul 26th, 2001, 01:46 PM
#3
Thread Starter
Addicted Member
Thanks for trying Sastraxi, but unfortunately, that's not it
-
Jul 26th, 2001, 02:52 PM
#4
Member
I'm thinking it might have to do with your last couple parameters on the .Line method ...
Remember that the way you're calc'ing x2 & y2 makes them relative to your origin. And since your origin isn't the upper-left corner (0,0), then you need to do a bit more calc'ing ... 
Code:
OriginX = face.Width \ 2
OriginY = face.Height \ 2
face.Line (OriginX, OriginY) - (OriginX + (x2 * 700), OriginY + (y2 * 700))
... or something like that. As an aside, notice that I used integer divide ("\") instead of the standard divide ("/") because it's faster and it results in an integer, which you'll need for your pixel coordinates anyway.
Hope that helps.
-Bryk
-
Jul 26th, 2001, 03:07 PM
#5
Thread Starter
Addicted Member
I did that Brykovian and the results did change! Unfortunately it's still not working as it should. After making the change you suggested I only needed to go through numbers 1 to 10 for the line to do a complete revolution. It is a start but still, more to do Any more suggestions anybody?
-
Jul 26th, 2001, 03:53 PM
#6
Code:
x2 = Cos(DtoR(degrees))
y2 = Sin(DtoR(degrees))
Z.
-
Jul 26th, 2001, 04:03 PM
#7
Thread Starter
Addicted Member
Thanks for trying but that makes it worse
-
Jul 26th, 2001, 05:42 PM
#8
transcendental analytic
Code:
Private Sub cmdGo_Click()
Dim rad As Double
face.Cls
rad = Val(txtDegrees.Text) * 1.74532925199433E-02 'pi/180
face.Line (face.Width / 2, face.Height / 2)-Step(Cos(rad) * 700, Sin(rad) * 700)
End Sub
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.
-
Jul 26th, 2001, 06:07 PM
#9
Member
Yah, hypnos ... I think Kedaman's code should do it ...
You did have your DtoR function wrong though ... you had the 180 and Pi thing flip-flopped ... shoulda been:
Code:
Private Function DtoR(degrees As Double) As Double
Dim rad As Double
rad = degrees / 180
DtoR = rad * PI
End Function
Ked's code takes this into effect, plus puts all of the intermediate steps onto fewer lines.
-Bryk
p.s. I'd forgot about the "step" feature on the .Line method ...
-
Jul 27th, 2001, 07:48 AM
#10
Thread Starter
Addicted Member
I'd like to thank all you guys for the help. You was right Brykovian, it was my Degrees to Radians function that was wrong. So, I changed it to the code you mentioned:
Code:
Private Function DtoR(degrees As Double) As Double
Dim rad As Double
rad = degrees / 180
DtoR = rad * PI
End Function
Now it's working perfectly! Once again, thank you all for the help!
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
|