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))
Printable View
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))
to convert radians to degree = radians * (180/pi)
to convert degree to radians = degree * (pi/180)
if i do deg=angle *(190/pi) i get a big number am i doing it wrong
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
i thought degrees went from 0 to 360 ,i just dont understand how to get degrees .
thanks
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
thank you now i understand it ,i wasnt even close
thanks
hey yall
is there anyway to get numbers 0-360 instead of + or - numbers?
thanks
Add 360 to the negative numbers and you'll have it.