Stop and go problem

I'm accelerating my ship with:dx += Math.cos(theta)*acceleration;
dy += Math.sin(theta)*acceleration;I want my deceleration to work in such a way that no matter what direction I'm facing, the speed is reduced toward 0. I also want this to be just as strong as my engines are in accelerating. So I figure the logic is to find the angle of the velocity vector, and reduce speed along that angle. So I find the angle with:double velocityAngle = Math.atan2(dy, dx);and then reduce my velocity's magnitude with:dx -= Math.cos(velocityAngle)*acceleration;
dy -= Math.sin(velocityAngle)*acceleration;This seems fine in my head logically, but in testing I've found that if I accelerate in one direction for 3 seconds, it only takes 2 seconds to stop. There are no other forces acting on my speed. Why are the times different?

Times like this, I'd kill for either a chaulkboard or a whiteboard.
I think what bothered me is that theta, as defined in the original problem, appears to be the direction that the ship is pointing in, as opposed to the direction that the ship is currently moving in. In other words, Malohkan's logic makes sense if the spaceship accelerates in one direction and then pivots in place such that theta no longer correspondes to the direction of motion.
Malohkan's solution then is to take the existing velocity vector and recompute what angle that vector points in. Once he has that angle, he can reduce the speed using the sin and cosine functions. The only problem with this approach is that he looses a second somewhere. I still suspect this is a result of the rounding errors that occur from finding the arctangent and then the sin and cosine - a glance at a trignometric table will reveal that these tend to be non-terminating decimals.
What we're trying to point out to Malohkan is that if he has the vector, it is not necessary to calculate the angle - in other words, it's not necessary to go from vector to angle to reverse angle to reverse vector... arg, writing out the formulae is much easier than trying to explain it via words. You will just have to take it on faith for now that mathematically speaking, the angle stuff always cancels itself out and you're left with the vector - reverse vector formula.
An alternate solution is to keep track of the current direction of motion as an angle separately from the current nose orientation - so when the spaceship pivots in place, he still has the angle of motion and doesn't need to recalculate that. That would remove one of the two potential rounding errors (due to the non-terminating decimals) and his answer would then be more accurate (but not totally so).

Similar Messages

  • TS1424 HELLO! whenever i try to access the itunes store from the itunes on my laptop i get this message: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is availabl

    for a few weeks i have not been able to access the itunes store from the itunes on my laptop. every time i click on it it tells me it cannot access the store...not sure why. and says this: ITUNES HAS STOPPED WORKING a problem caused the program to stop working correctly. windows will close the program and notify if a solution is available.

    I had this exact same problem.  I found this fix and it worked for me. 
    Step 1:
    Browse to C:\Program Files (x86)\Common Files\Apple\Apple Application Support and copy the filen named QTMovieWin.dll. 
    Step 2:
    Browse and past that file into C:\Program Files (x86)\iTunes.
    Hope this helps you.  I wish I could remember where I saw this originally so I could thank them.
    Good Luck.
    Anthony

  • Windows 8 - Photoshop CS5.1 crashes upon startup. Error message: "Adobe Photoshop CS5.1 has stopped working.A problem caused by the program to stop working correctly. Windows will close the program and notify you if a solution is available."

    Hello!
    I've had the student version of the Adobe Creative Suite 5.5 Design Premium software for several years now.
    When I received my Windows 8 computer I installed the software with no issue.
    Last week when I tried opening Photoshop I get the following error: "Adobe Photoshop CS5.1 has stopped working.A problem caused by the program to stop working correctly. Windows will close the program and notify you if a solution is available."
    I deactivated and uninstalled the entire Creative Suite then reinstalled it. I am able to open the other programs, but still receive the same message for Photoshop.
    What can I do?

    I found the issue was with the Nik Filters I was using. The filters were messing with Photoshop's initializing. I uninstalled and reinstalled the filters and now Photoshop works like a charm.
    It appears this forum is dead?!
    Thankfully, I was able to troubleshoot on my own and figured out the problem...

  • Im trying to do itunes match i get to the third part which it says gathering artwork and songs and about half way through it stops and says ther is a problem sign out and sign in again which i do and still it happens getting really frustrated please help

    Hi im having problems loading itunes match everytime it gets to the third installment it stops and tells me there is a problem sign out and sign in again which i do and still the same problem. I did get an email saying notice about your apple id and to verify now but when i go to page its saying 404 not found im now ready to ditch apple products and go else where every where i turn theres a problem this is my final calling please help.

    Hi im having problems loading itunes match everytime it gets to the third installment it stops and tells me there is a problem sign out and sign in again which i do and still the same problem. I did get an email saying notice about your apple id and to verify now but when i go to page its saying 404 not found im now ready to ditch apple products and go else where every where i turn theres a problem this is my final calling please help.

  • This mini is operating OSX 10.6.8 and trying to update to Mountain Lion but upgrade stops and a black overscreen displays saying to power off and power on.  The upgrade fails.  What's the problem?

    This mini is operating OSX 10.6.8 and trying to update to Mountain Lion but upgrade stops and a black overscreen displays saying to power off and power on.  The upgrade fails.  What's the problem?

    Hi Fred,
    Could be many things, we should start with this...
    "Try Disk Utility
    1. Insert the Mac OS X Install disc, then restart the computer while holding the C key.
    2. When your computer finishes starting up from the disc, choose Disk Utility from the Installer menu at the top of the screen. (In Mac OS X 10.4 or later, you must select your language first.)
    Important: Do not click Continue in the first screen of the Installer. If you do, you must restart from the disc again to access Disk Utility.
    3. Click the First Aid tab.
    4. Select your Mac OS X volume.
    5. Click Repair. Disk Utility checks and repairs the disk."
    http://docs.info.apple.com/article.html?artnum=106214
    Then try a Safe Boot, (holding Shift key down at bootup), run Disk Utility in Applications>Utilities, then highlight your drive, click on Repair Permissions, reboot when it completes.
    (Safe boot may stay on the gray radian for a long time, let it go, it's trying to repair the Hard Drive.)

  • My iPod will not charge at all it will when it's off it will power on and charge to a certain pint then will stop and no longer charge what is its problem I've tried 3 cords and three different outlets and also in my computer! What is wrong with it?

    My iPod will not charge at all it will when it's off it will power on and charge to a certain pint then will stop and no longer charge what is its problem I've tried 3 cords and three different outlets and also in my computer! What is wrong with it?it won't charge when it's powered on only when it s off then it turns on and stops charging?? What's wrong with it ad how much is a Genius Bar appt at apple stores??

    Not Charge
    - See:      
    iPod touch: Hardware troubleshooting
    - Try another cable. Some 5G iPods were shipped with Lightning cable that were either initially defective or failed after short use.
    - Try another charging source
    - Inspect the dock connector on the iPod for bent or missing contacts, foreign material, corroded contacts, broken, missing or cracked plastic.
    - Make an appointment at the Genius Bar of an Apple store.
      Apple Retail Store - Genius Bar 

  • Firefox4 on ubuntu, after awhile when I click on bookmarks and then move the cursor down to a bookmark, the list of bookmarks disappears. A stop and start of firefox4 fixes the problem but what is the long term fix?

    I upgraded to 4 and I noticed that after 4 has been up for an hour or so I click on the bookmarks. I see my list of bookmarks below but when I move the cursor down to select one, the list disappears.
    The only way I have found to fix this is to stop and start 4. I can then move the cursor down to select a bookmark. This problem has not occurred in previous versions.
    ps.. no '''''delicious''''' installed

    No, I see the three areas at the bottom of the Bookmark area that you refer to, but that also highlights an issue.  When I want to save a story to my Reading List and click on Share then "Add to Reading List" then go back to look at what is stored in the Reading List, my recently-saved item is not there.
    I looked thru the History tab and the Reading List tab and have been in the Bookmark tab.  But even when I Save a Bookmark, that newly-saved Bookmark does not show up in the Bookmark area.
    But then again, the next day (and actually just in the last half-hour) all of the functionality came back.  When I look at the Bookmarks, suddenly, again, all of the Bookmarks that are on my Safari browser on my iMac are now there, and I can now Save a Bookmark.
    It keeps coming in and out and that is what is driving me a little nuts.
    Thanks.

  • Error when opening itunes : iTunes has stopped working ''A problem caused the program to stop working correctly''. When I repaired damaged files the problem still exists and also after uninstalling and redownloading and installing itunes. I have windows 8

    Error when opening iTunes : iTunes has stopped working '' A problem caused the program to stop working correctly''.
    When I repaired damaged files the problem still exists and also after uninstalling, redownloading and reinstalling iTunes.
    My pc is working with windos 8.
    Is there a solution?

    Hey there Rodney274,
    It sounds like you are getting an error from iTunes when you launch it. I would try the troubleshooting in this article named:
    iTunes for Windows Vista, Windows 7, or Windows 8: Fix unexpected quits or launch issues
    http://support.apple.com/kb/ts1717
    Start with troubleshooting for 3rd party plug ins section, then the rest of the article if needed:
    Start iTunes in Safe Mode
    Open iTunes in Safe Mode to isolate any interference from plug-ins or scripts not manufactured by Apple.
    Hold down Shift–Control while opening iTunes. You should see a dialog that says "iTunes is running in safe mode" before iTunes finishes starting up.
    Click Continue.
    See if the issue you're experiencing persists in Safe Mode.
    If you have the same issue while iTunes is in Safe Mode, proceed to the "Create a new user account" section. If you don't experience the same issue, follow these steps to remove third-party plug-ins.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

  • Hello friends, my itunes has stopped working. and the problem report stated the following: Fault Module Name:     KERNELBASE.dll   Fault Module Version:     6.1.7601.17514.................. please can anybody help me?hello friends, my itunes has stopped w

    Hello everybody> my itunes has stopped working and the problem report stated the following:
    Problem signature:
      Problem Event Name:    APPCRASH
      Application Name:    iTunes.exe
      Application Version:    10.5.3.3
      Application Timestamp:    4f14cc3d
      Fault Module Name:    KERNELBASE.dll
      Fault Module Version:    6.1.7601.17514
      Fault Module Timestamp:    4ce7b8f0
      Exception Code:    80000003
      Exception Offset:    0003381b
      OS Version:    6.1.7601.2.1.0.256.1
      Locale ID:    1033
      Additional Information 1:    0a9e
      Additional Information 2:    0a9e372d3b4ad19135b953a78882e789
      Additional Information 3:    0a9e
      Additional Information 4:    0a9e372d3b4ad19135b953a78882e789
    can anybody help me?

    Are you seeing a similar message when launching QuickTime Player?
    What security software is installed on the computer? Have you tried testing in an admin account or after uninstalling tthe security software?
    Use one of the following articles to guide you through removing iTunes and the related QuickTime files.
    Removing and Reinstalling iTunes, QuickTime, and other software components for Windows XP
    Removing and reinstalling iTunes, QuickTime, and other software components for Windows Vista or Windows 7

  • Problem stop and start the ias 6.0

    Hi all,
    i have a problem when i stop and start the ias 6.0 sp2. The problem
    apparent is that when i stop the ias the IAS web connector plugin stop,
    then i start the ias and when i try to connect to a servlet in my ias
    the page i find in my brwser tell me "The documento contained no
    data.Try later again ..". Afte this i see that the IAS web plugin begin
    to start and then the same connect to the servlet works.
    Somebody can help me.
    Thanks in advance.
    Ignacio Ramos Garcia
    Division TSO
    Area de Telecomunicaciones
    Tecsidel
    C/ Enrique Jardiel Poncela, 6
    28016 Madrid
    Tel: (+34) 91 353 08 19
    Fax: (+34) 91 353 08 81
    <mailto:[email protected]>
    www.tecsidel.es

    Hi,
    This really looks like a problem, kindly let me know the following...
    - The O/S version & the web server with the service pack
    - What method are you using to start & stop the application & web
    server ?
    - What application are you invoking to see this error ?
    Regards
    Raj
    Ignacio Ramos Garcia wrote:
    Hi all,
    i have a problem when i stop and start the ias 6.0 sp2. The problem
    apparent is that when i stop the ias the IAS web connector plugin stop,
    then i start the ias and when i try to connect to a servlet in my ias
    the page i find in my brwser tell me "The documento contained no
    data.Try later again ..". Afte this i see that the IAS web plugin begin
    to start and then the same connect to the servlet works.
    Somebody can help me.
    Thanks in advance.
    Ignacio Ramos Garcia
    Division TSO
    Area de Telecomunicaciones
    Tecsidel
    C/ Enrique Jardiel Poncela, 6
    28016 Madrid
    Tel: (+34) 91 353 08 19
    Fax: (+34) 91 353 08 81
    <mailto:[email protected]>
    www.tecsidel.es

  • HT6058 I have updated my I pad dut I'm still having problems my iPad seems to freeze and when I go to put in my pin it take a few seconds before the numbers go in and my games stop and start and stop and start for a bit before they run properly

    I have updated my I pad dut I'm still having problems my iPad seems to freeze and when I go to put in my pin it take a few seconds before the numbers go in and my games stop and start and stop and start for a bit before they run properly

    Try this  - Reset the iPad by holding down on the Sleep and Home buttons at the same time for about 10-15 seconds until the Apple Logo appears - ignore the red slider - let go of the buttons. (This is equivalent to rebooting your computer.) No data/files will be erased.
     Cheers, Tom

  • My nano 5th generation, plays a little music stops and reboot. the videos play without a problem, what can i do?

    my nano 5th generation plays a little music, then stops and reboots.  only when i play music.  it does this each time i play music,   the videos plays non stop, no problem.  what is the problem?  .....PLEASE HELP!

    Hi maryboneapart,
    If your iPod nano is restarting itself while playing music, I would suggest trying each of the steps in this troubleshooting assistant, checking after each one to see if the problem continues:
    iPod nano (5th generation) Troubleshooting
    http://www.apple.com/support/ipod/five_rs/nano5gen/
    Cheers!
    - Ari

  • I am trying to download the iTunes 10.7 update so that i can update my ipod and just before the final part of the download starts the program stops and says, 'The installer enountered problems before iTunes could be configured'    What a i doing wrong?!

    I am trying to download the iTunes 10.7 so that i can update my ipod. Just before the final part f the download starts the program stops and says, 'The installer encountered problems before iTunes could be configured'
    What am I doing wrong?!

    I am trying to download the iTunes 10.7 so that i can update my ipod. Just before the final part f the download starts the program stops and says, 'The installer encountered problems before iTunes could be configured'
    What am I doing wrong?!

  • I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    I bought the APP Sasol Birds. 146MB of the 147,5MB downloaded without any problem. The download stopped and first the error code 3259 and later the error code 8012 appeared. Can someone help? I want the download to be completed. Thank you. Pieter Strobos

    Maybe your firewall or security software are preventing the download from finishing. You could try disabling them until you finish the download

  • TS1424 Does anyone know about a problem 12001 downloading a movie?  The download was stopped and will not start again.

    This occurred whilst downloading.  The download stopped and now I can't start it again.  Even if I try to purchase it again I can't, as it says 'downloaded' instead of the price tag.  I'd love to know the answer as we are in the middle of the third season of 'Game of Thrones'! Thanks.

    This response is a little late as I just read about your problem. I have a 2012 Dodge Charger and a 2012 Chrysler Town and Country and both worked flawlessly with the iPhone 5s my wife and I had. However, we just upgraded to the iPhone 6 and Uconnect will receive calls but you cannot answer them. You can callout successfully, however. the annoyance being the inability to answer incoming calls in the HandsFree mode.

Maybe you are looking for

  • Customer clearing logic

    Hi,    Why we need to clear customer in F-32 after when we have booked a collection in F-28. We have been using this process since a long. What are implications if we remove this process and apply payment as soon as its booked. Guide please

  • Mail, Contacts and Calendars in Settings crashes; Contacts app is blank

    First issue - since upgrading my iPad2 to iOS5, the Mail, Contacts and Calendars in Settings crashes. All other options in Settings are fine - only issues is with Mail, Contacts and Calenders crashing. Second issue - I am using iCloud to sync contact

  • BUying the phone form the Apple store vs the phone store

    Is there any advantage to buying the phone from the Apple store vs the ATT people? I found with my Treo the ATT folks don't know much about it and also didn't offer any insurance for it either!

  • Use of external keypad with internal keyboard

    Hi folks, I've just got my new Tecra S4-122, of course without an integrated numeric keypad, so I've such a thing too. The problem is now that I'm not able to use the numbers on the keypad without activating the internal "keypad" (Use of normal lette

  • Cmd-~ not cycling windows Illustrator CS6 Mac

    Mac Air 10.9.4, Illustrator CS6 Since I upgraded to a laptop I have not been able to get the 'cycle windows' within Illustrator to work (cmd - ~). Doesn't seem to matter if settings are set to tabs or floating windows (preferred). Works fine in Photo