public void IntegrateCoordinates(OnSensorChangedArgs args) { Coords.X += Coords.Vx * args.TimeStep; Coords.Y += Coords.Vy * args.TimeStep; Coords.Z += Coords.Vz * args.TimeStep; Coords.Vx += args.AccelerationX * args.TimeStep; Coords.Vy += args.AccelerationY * args.TimeStep; Coords.Vz += args.AccelerationZ * args.TimeStep; CoordsChanged(Coords); }
void UpdateTexts(OnSensorChangedArgs args) { switch (ChosenAxis) { case (Axis.AxisX): accText.Text = string.Format("A.x = {0}", args.AccelerationX); gravText.Text = string.Format("G.x = {0}", args.GravityX); break; case (Axis.AxisY): accText.Text = string.Format("A.y = {0}", args.AccelerationY); gravText.Text = string.Format("G.y = {0}", args.GravityY); break; case (Axis.AxisZ): accText.Text = string.Format("A.z = {0}", args.AccelerationZ); gravText.Text = string.Format("G.z = {0}", args.GravityZ); break; } }