|
-
Sep 2nd, 2011, 07:55 PM
#1
Thread Starter
Fanatic Member
[RESOLVED] how do i change angle into a degre
when i use this i get a very large number how do i change it to degrees to get less numbers?
thanks
Code:
Angle = Atn((Y2 - Y1) / (X2 - X1))
-
Sep 2nd, 2011, 09:22 PM
#2
Re: how do i change angle into a degre
to convert radians to degree = radians * (180/pi)
to convert degree to radians = degree * (pi/180)
-
Sep 2nd, 2011, 11:10 PM
#3
Thread Starter
Fanatic Member
Re: how do i change angle into a degre
if i do deg=angle *(190/pi) i get a big number am i doing it wrong
-
Sep 2nd, 2011, 11:19 PM
#4
Addicted Member
Re: how do i change angle into a degre
This may help you:
Code:
Public Function (D) as double
Degrees (D) *(180/pi)
End function
'if you want to round just use Round((D),2)
'D = Degrees
-
Sep 2nd, 2011, 11:24 PM
#5
Re: how do i change angle into a degre
 Originally Posted by flyhigh
if i do deg=angle *(190/pi) i get a big number am i doing it wrong
it shud be 180 not 190, and what u mean by big number? can u pls explain what u need exactly?
-
Sep 3rd, 2011, 12:29 AM
#6
Thread Starter
Fanatic Member
Re: how do i change angle into a degre
i thought degrees went from 0 to 360 ,i just dont understand how to get degrees .
thanks
-
Sep 3rd, 2011, 12:47 AM
#7
Re: how do i change angle into a degre
try this to get angle of a line
Code:
Private Sub Command1_Click()
'just draw a line in form using line control named as Line1
Dim pi As Double, Angle As Single
pi = 4 * Atn(1) 'pi value
With Line1
Angle = Atn((.Y2 - .Y1) / (.X2 - .X1)) 'returns the radians
Angle = Angle * (180 / pi) 'convert radians to degree
End With
MsgBox Round(Angle, 2) 'round up
End Sub
-
Sep 3rd, 2011, 01:15 AM
#8
Thread Starter
Fanatic Member
Re: how do i change angle into a degre
thank you now i understand it ,i wasnt even close
thanks
-
Sep 3rd, 2011, 01:22 PM
#9
Thread Starter
Fanatic Member
Re: [RESOLVED] how do i change angle into a degre
hey yall
is there anyway to get numbers 0-360 instead of + or - numbers?
thanks
-
Sep 3rd, 2011, 01:41 PM
#10
Re: [RESOLVED] how do i change angle into a degre
Add 360 to the negative numbers and you'll have it.
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
|