Results 1 to 6 of 6

Thread: y=mx+b

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113

    Red face

    i'm looking for the best way to move a ball on a
    angle with velocity
    I think i could use y = mx + b or somthing

    eg.
    angle = 90:velocity = 1
    this will send the ball up slowly.
    (i don't want to say ware the ball will go just the angle)

    [Edited by BIacksun on 10-13-2000 at 06:46 PM]

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Code:
    vy=sin(angle)*Velocity
    Vx=cos(angle)*Velocity
    well you move the ball like with a velocity vector, add the velocity component x and y to the ball coordinates.
    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.

  3. #3
    Frenzied Member /\/\isanThr0p's Avatar
    Join Date
    Jul 2000
    Location
    They can't stop us! We're on a misson from God.
    Posts
    1,181
    No that's a equation for a linear thing!
    you should use something like y =x*x

    or you could use a 'ballistic' equation.

    Sanity is a full time job

    Puh das war harter Stoff!

  4. #4
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Misantrop, ballistical equations are quite too complicated for this case
    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.

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Sep 2000
    Posts
    113
    this is starting to work

    Velocity = 1
    ang = 90 * 3.14159
    Do
    X = Shape2(1).Left
    y = Shape2(1).Top

    X = X + Sin(ang)
    y = y + Cos(ang)

    Shape2(1).Left = X
    Shape2(1).Top = y

    For n = 1 To 1000
    DoEvents
    Next n
    a = a + 1
    Loop Until a = 1000

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    wait a minute, you have to convert pi/180 degrees to get radians:
    Code:
    ang = 90 * 3.14159 /180
    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.

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