User Tag List

Results 1 to 7 of 7

Thread: Predicting Tartget Speed

  1. #1
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Predicting Tartget Speed

    Hi

    I have a Ball.

    - The Ball moves forward at an initial speed S ( pixels per frame ).
    - Every Frame the Balls current Speed is multiplied by 0.99

    I need to determine, ahead of time through an expression, how far the Ball has traveled when Ball has reached TS ( Target Speed; always lower than initial speed ).

    ...
    How do i need to think to solve something like this?
    How can i solve this?

  2. #2
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    "How do I need to think to solve something like this?"

    If you're familiar with Newton's equations of motion (fairly standard school maths), you have a constant acceleration (actually a deceleration, since you're multiplying your speed by a value less than 1, in your case 0.99) so you can use the SUVAT equations

    #3 seems to fit the bill:

    s=0.5(u+v)t

    where:
    s=distance travelled (pixels in your example)
    u=starting velocity (in your example S)
    v=ending velocity (in your example TS)
    t=time (in your case number of frames)

    If you need to calculate t beforehand, you can use #1:

    v=u+at
    so t=v/(u+a)

    a=acceleration (in your example -0.99, I think)

    Hope that gets you on the right track!

  3. #3
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Without any background in physics this would be hard to figure out.
    ...Maybe i should take up physics on the side...

    Ill post back as soon as i get it working.
    Thanks AyreGuitar!

  4. #4
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Is Speed and Velocity the same thing?

    "Velocity is a vector quantity that refers to "the rate at which an object changes its position.""

    "Speed is a scalar quantity that refers to "how fast an object is moving.""

  5. #5
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Either its not working or im doing something wrong.
    https://dl.dropboxusercontent.com/u/...Prediction.mfa

    Would it be significantly easier to predict Travel Distance at 50% of Initial Speed?

  6. #6
    Clicker Fusion 2.5 DeveloperAndroid Export ModuleiOS Export ModuleMac Export ModuleUnicode Add-on
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)Universal Windows Platform Export Module (Steam)
    AyreGuitar's Avatar
    Join Date
    Jan 2011
    Location
    Wales, UK
    Posts
    1,113
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You're right it's not working.

    I think I made an error in thinking that using speed=0.99*speed is using constant acceleration, some quick calculations reveal that its not - sorry about that!
    Also I don't think -0.99 would have been your acceleration (it's more like -0.04, you can calculate it by using v=u+at, so a=(v-u)/t, a=(4*0.99-4)/1=-0.04)
    I also should have been using SUVAT equation 4 in my link, so

    s=(v*v-u*u)/2*a

    If u=4, v=3 and a=-0.04 this results in s=(9-16)/2*(-0.04)=-7/-0.08=87.5 which is closer but a little off as a keeps decreasing:
    frame 1, a=((4*0.99)-4)/1=-0.04
    frame 2, a=((3.96*0.99)-4)/2=-0.0398
    etc

    To use these equations accurately, you'd need constant acceleration, ie speed=speed+Value rather than speed=speed*Value
    If you need to use something like speed=speed*Value, you might be better off using a fast loop and calculating the new distance and speed until speed<=target speed

    Sorry for the confusion!

    I've attached an updated version of your example in case it helps (there was definitely something wrong with the expression as even with the new acceleration it still gave very small values, but I've re-written it to use a 'proper' version of acceleration)

    BTW About Velocity and Speed, most of the time you can use them in the same way, the main thing is that velocity has a direction (Vector) and speed does not (Scalar), so if direction is important use velocity instead of speed.
    Attached files Attached files

  7. #7
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)iOS Export Module (Steam)
    King_Cool's Avatar
    Join Date
    Aug 2008
    Posts
    2,335
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm, i see.
    So if i want to comunicate a Velocity to someone, it wont make sense unless i comunicated a speed and a direction/ angle.
    Thanks AyreGuitar!

    ...
    I actually managed to find an expresion which is very accurate:

    V_i = VelocityInitial
    V_t = VelocityTarget
    D = Deceleration

    ( ( 0.0 + V_i ) / Ln( D ) ) * ( D ^ ( Ln( ( 0.0 + V_t ) / V_i ) / Ln( D ) ) - 1 )

Similar Threads

  1. Predicting Movement Time
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 11
    Last Post: 9th May 2013, 03:25 PM
  2. Predicting X ( point of impact ) 2
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 1st June 2012, 11:25 PM
  3. Predicting X ( point of impact )
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 6
    Last Post: 1st June 2012, 10:53 PM
  4. Pinball Movement: Predicting inpact coordinated
    By King_Cool in forum Multimedia Fusion 2 - Technical Support
    Replies: 0
    Last Post: 14th May 2012, 10:36 PM
  5. predicting a future position
    By Bigfoot in forum Multimedia Fusion 2 - Technical Support
    Replies: 4
    Last Post: 6th July 2010, 09:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •