From 94ade845a72bc8f742b1661aec179a482ba49c97 Mon Sep 17 00:00:00 2001 From: Narayan Kamath Date: Thu, 24 Oct 2013 19:15:06 +0100 Subject: [PATCH] Remove invalid UTF-8 chars from source. Double checked that the time corrected verlet equation is still readable. (If it isn't there's always wikipedia). Change-Id: I6573a4a096c2f2089968c19c79465b37540c2197 --- .../AccelerometerPlayActivity.java | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java b/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java index c9e840fd1..f71cf9f20 100644 --- a/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java +++ b/samples/AccelerometerPlay/src/com/example/android/accelerometerplay/AccelerometerPlayActivity.java @@ -165,7 +165,7 @@ public class AccelerometerPlayActivity extends Activity { final float gy = -sy * m; /* - * ·F = mA <=> A = ·F / m We could simplify the code by + * F = mA <=> A = F / m We could simplify the code by * completely eliminating "m" (the mass) from all the equations, * but it would hide the concepts from this sample code. */ @@ -175,12 +175,12 @@ public class AccelerometerPlayActivity extends Activity { /* * Time-corrected Verlet integration The position Verlet - * integrator is defined as x(t+Æt) = x(t) + x(t) - x(t-Æt) + - * a(t)Ætö2 However, the above equation doesn't handle variable - * Æt very well, a time-corrected version is needed: x(t+Æt) = - * x(t) + (x(t) - x(t-Æt)) * (Æt/Æt_prev) + a(t)Ætö2 We also add - * a simple friction term (f) to the equation: x(t+Æt) = x(t) + - * (1-f) * (x(t) - x(t-Æt)) * (Æt/Æt_prev) + a(t)Ætö2 + * integrator is defined as x(t+dt) = x(t) + x(t) - x(t-dt) + + * a(t).t^2 However, the above equation doesn't handle variable + * dt very well, a time-corrected version is needed: x(t+dt) = + * x(t) + (x(t) - x(t-dt)) * (dt/dt_prev) + a(t).t^2 We also add + * a simple friction term (f) to the equation: x(t+dt) = x(t) + + * (1-f) * (x(t) - x(t-dt)) * (dt/dt_prev) + a(t)t^2 */ final float dTdT = dT * dT; final float x = mPosX + mOneMinusFriction * dTC * (mPosX - mLastPosX) + mAccelX