Results 1 to 3 of 3

Thread: Mathmatical code.

  1. #1

    Thread Starter
    Member
    Join Date
    Jan 2005
    Posts
    58

    Mathmatical code.

    Hey i have a mathmatical code that i want to put into a VB program does anyone hav a good idea how i can do it. im not sure what language this code is in but i want to make a program that draws a line that uses this formula to bend.

    Code:
    'Parameters needed:
    'wind
    'windir (wind direction)
    'angle
    'power (silver marker) (value 0 - 400)
    
    Dim w1 as double = wind * 2 - 1
    If w1 < 0 Then w1 = 0
    
    Dim ca As Double = Math.Cos(angle / 180.0 * 3.14159265358979)
    Dim cw As Double = Math.Cos(windir * 3.14159265358979 / 180.0)
    Dim wind2 As Double = w1 * cw
    Dim X As Double = ca * 920 * power / 400
    
    Dim w2 As Double = wind * 2 - 1
    If w2 < 0 Then w2 = 0
    
    Dim sa As Double = Math.Sin((angle / 180.0 * 3.14159265358979))
    Dim sw As Double = Math.Sin((windir * 3.14159265358979 / 180.0))
    Dim wind3 As Double = we * sw
    Dim Y As Double = sa * 920 * power / 400
    
    Dim i As Double 'This one MUST be double, or at least decimal
    
    'To draw the line going right
    For i = 0.0 To 12.0 Step 0.05
    Dim drawx As Double = (PointOfOriginX) + (X * i + wind2 * i * i)
    Dim drawy As Double = (PointOfOriginY) - (Y * i - wind3 * i * i - 0.5 * (387) * i * i)
    
    ('To draw the line going left
    For i = 0.0 To 12.0 Step 0.05
    Dim drawx As Double = (PointOfOriginX) - (X * i - wind2 * i * i)
    Dim drawy As Double = (PointOfOriginY) - (Y * i - wind3 * i * i - 0.5 * (387) * i * i))
    
    If i = 0.0 Then
    MoveToEx((DC), CInt(X - 2), CInt(Y - 2), 0) 'For DC you can use a simple GetDC(0)
    Else
    LineTo((DC), CInt(X - 2), CInt(Y - 2))
    End If

  2. #2
    Member
    Join Date
    Feb 2005
    Posts
    48

    Re: Mathmatical code.

    Are you trying to make an aimbot for Gunbound? lol
    I make a timer and put the code in it.

  3. #3
    Elite Hacker Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,349

    Re: Mathmatical code.

    That language is VB.NET. It wouldn't be too hard to convert it to regular VB.

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