# Animated Objects drifting towards origin - suspect loss of precision issue

**URL:** <https://forum.kirupa.com/t/animated-objects-drifting-towards-origin-suspect-loss-of-precision-issue/320524>\
**Category:** flash\
**Created:** [March 26, 2011, 1:28am UTC](https://forum.kirupa.com/t/animated-objects-drifting-towards-origin-suspect-loss-of-precision-issue/320524 "2011-03-26T01:28:22Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![cermunnos](https://avatars.discourse-cdn.com/v4/letter/c/ebca7d/32.png) [@cermunnos](https://forum.kirupa.com/u/cermunnos)\
**Post date:** [March 26, 2011, 1:28am UTC](https://forum.kirupa.com/t/animated-objects-drifting-towards-origin-suspect-loss-of-precision-issue/320524/1 "2011-03-26T01:28:22Z")

</div>

Hi,

I’m working on a physics program with 2 bodies orbiting around each other using basic newtonian mechanics.

My problem is I notice my objects are drifting towards the origin.

In my codes I run my equations and then I add a value to the x and y of the objects to move them.

like so:

```auto

Some code using x and y to calculate new xvelocities
...

x+=xVelocity;
y+=yVelocity;
trace(x.toFixed(8));

```

What i notice about the x & y value of my objects is that when i trace them they have only 2 decimal place precision. Why is this? This may be the cause of my issue but im not sure. Has anybody encountered anything similar before?

**Trace Output**  
200.15000000  
195.50000000  
200.20000000  
200.20000000  
192.50000000  
200.20000000
