Questions tagged [acceleration]

ambiguous tag: avoid using this tag (see the full tag wiki for alternatives)

This tag is currently ambiguous and unlikely to get your question extra attention. Consider using the following tags for better classification:

175 questions
2
votes
1 answer

Unity (iOS) device angle on one axis

I'm creating a game in Unity which takes input from the physical rotation of the device and turns it into a force applied to the main character (a ball). Using Input.Acceleration it currently works just fine, and I added a z-axis offset so you can…
Topaz
  • 21
  • 3
2
votes
0 answers

Accelerometer not working on Android-wear emulator

sensor set acceleration 9.77621:0:0 is not working for Android wear emulator.. I have register event for sensor value change, but not getting any call back. is it suppose to work differently then phone? (using mac)
Umair
  • 1,206
  • 1
  • 13
  • 28
2
votes
1 answer

going to a particular position with constant speed using accelStepper in arduino

I've been trying to make a simple two axis cnc. I am just in the beginning phase to I just wanted to check out the accelStepper library. With the help of constantSpeed and Bounce sketch example I got some idea and wrote the following code. …
Diwakar
  • 63
  • 1
  • 3
  • 10
2
votes
1 answer

How do I incorporate speed and/or acceleration into a (WPF) scrollviewer?

I have a WPF scrollViewer that I use for panning (MouseDown, MouseMove, MouseUp) and I would like to include an acceleration effect that incorporates inertia. So, if the mouse moves beyond a threshold speed and I release the mouse, it continues to…
Brad
  • 1,187
  • 3
  • 23
  • 44
2
votes
1 answer

Android barrier detection of accelerating object

my app contains an object moving on a surfaceview. I am able to move it around via accelerometer. Here's the movement code of the player object: if(x + mx*speed > 0 && x + mx*speed < GameView.WIDTH) { x += mx*speed; } if(y+ my*speed > 0…
user2410644
  • 3,861
  • 6
  • 39
  • 59
2
votes
1 answer

How to normalize acceleration with orientation?

Acceleration is tracked (X,Y,Z) in m/s^2 relative to the phone. Orientation is tracked in Euler angles relative to "earth". Can I use orientation to calculate acceleration relative to "earth"? If yes, could you explain how to do it? I've created a…
markmarijnissen
  • 5,569
  • 2
  • 28
  • 34
2
votes
1 answer

"shake to do something" code explanation

I've found this code, Its function is to do something when the device is shaken strong enough, but I haven't fully understood it . Anyone please help me public class ShakeActivity extends Activity { /** Called when the activity is first created.…
lk7630
  • 21
  • 3
1
vote
1 answer

hardwareAccelerated animation in Android 2.2

is there any way to do run animation on the GPU when writing an app for Android 2.2 and up Thanks.
user958880
  • 487
  • 1
  • 7
  • 18
1
vote
0 answers

Unity 2D deceleration function not working

I have written a C# file for 2D sidescroller player movement. To add some flair, I have attempted to add acceleration and deceleration to the movement, by dynamically calculating the speed of the player based on the previous speed and current…
Sewiwey
  • 21
  • 1
1
vote
1 answer

Android: Scrollbar Accelerator?

I'm writing an Android application that contains lots of long lists and I need to accelerate scrolling somehow. The Android Contacts application for example uses a list of letters to allow quick scrolling to a certain spot in the list ... it's not…
Harry Muscle
  • 2,247
  • 4
  • 38
  • 62
1
vote
2 answers

GPU-accelerate neural network calculations

I'm trying to accomplish Nvidia's "Fundamentals of Accelerated Computing with CUDA Python" course and have got a task to refactor a simple version of some code that performs work needed to create a hidden layer in a neural network: import numpy as…
kndrtt
  • 13
  • 4
1
vote
1 answer

Interpolate time for given speed

I have array of data points where x is speed and y is a timestamp, some data points are missing time, what would be correct formula to calculate interpolated time for certain speed based on other data point. Basically this is acceleration time up to…
1
vote
1 answer

How to optimize this Radix-Sort algorithm in C++?

I am working with this assignment of optimizing a radix sort code in C++ and I need to reduce the execution time, my code is working and it looks like this: void RadixSort::RadixSortNaive(std::vector &Arr) { long Max_Value = findMax(Arr); …
1
vote
1 answer

Capping Speed on 2D Spaceship

So like just about everyone else learning some programming language, I've given myself a spaceship game project. So far, I have parallax stars and all the nice things I expect from a spaceship game. The ship stays in the center of the game screen,…
Adrian
  • 727
  • 1
  • 9
  • 17
1
vote
2 answers

Adding constant acceleration to this pendulum code

How can I add constant acceleration to this pendulum as a whole while using this code? The code right now is describing a pendulum, how would I alter it to describe a pendulum in a moving train (where the train has a constant acceleration)? Any help…