Results 1 to 10 of 10

Thread: [RESOLVED] how do i change angle into a degre

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Resolved [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))

  2. #2
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    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)
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  3. #3

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    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

  4. #4
    Addicted Member
    Join Date
    Apr 2009
    Posts
    177

    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

  5. #5
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    Re: how do i change angle into a degre

    Quote Originally Posted by flyhigh View Post
    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?
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  6. #6

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    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

  7. #7
    Just a Member! seenu_1st's Avatar
    Join Date
    Aug 2007
    Location
    India
    Posts
    2,170

    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
    Seenu

    If this post is useful, pls don't forget to Rate this post.
    Pls mark thread as resolved once ur problem solved.
    ADO Tutorial Variable types SP6 for VB6, MsFlexGrid fast fill, Sorting Algorithms


  8. #8

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    Re: how do i change angle into a degre

    thank you now i understand it ,i wasnt even close
    thanks

  9. #9

    Thread Starter
    Fanatic Member
    Join Date
    Feb 2009
    Posts
    573

    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

  10. #10
    Frenzied Member
    Join Date
    Jun 2006
    Posts
    1,098

    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
  •  



Click Here to Expand Forum to Full Width