4
$\begingroup$

I'm developing an application using accelerometer sensor. I'm not good at physics so forgive me if the question is trivial. If I have 3 values of acceleration: $x$, $y$, $z$, I find acceleration magnitude by taking square root of $x^2+y^2+z^2$, but how do I find it's sign? Example reading:

x: -0.010020584

y: 0.010257386

z: -0.04910469

The magnitude will be around 0.05115, but how do I know if it is deceleration or acceleration?

$\endgroup$
1

2 Answers 2

4
$\begingroup$

If your question is: "How do I know if the acceleration is increasing or decreasing the speed?" the answer is:

Calculate $\mathbf{a}\cdot\mathbf{v}$, where $\mathbf{a}$ is the acceleration vector ($(x,y,z)$ in your notation) and $\mathbf{v}$ is the velocity vector, and check its sign. If it is positive the speed is increasing, otherwise it is decreasing.

In your example:

$$ \mathbf{a}=(-0.010020584,0.010257386,-0.04910469) $$

Let's say for simplicity that $\mathbf{v}=(1,1,1)$. We then have:

$$ \mathbf{a}\cdot\mathbf{v}=(-0.010020584)\cdot1+0.010257386\cdot1+(-0.04910469)\cdot1=-0.048867888 $$

The negative sign of the result means that the speed is decreasing.

$\endgroup$
4
  • $\begingroup$ the thing is I'm trying to find velocity by integrating acceleration. v=v0+at as far as I know, but v keeps increasing even if the object stops or decelrates, because square root always gives positive value. $\endgroup$
    – Nazerke
    Mar 29, 2013 at 19:32
  • $\begingroup$ @Nazerke Why are you integrating the magnitude of the acceleration? That makes no sense unless the acceleration is always along the same direction. You should integrate the acceleration vector to get the velocity vector. Then you can calculate the magnitude of the velocity vector to get the speed if that is what you want to know. $\endgroup$
    – jkej
    Mar 30, 2013 at 3:14
  • $\begingroup$ at that moment I didn't know if I need magnitude or not, I just wrote it to make the question clearer. if I have ax, I can find vx by integrating ax, that is vx = v0+ax * t, same way I can find vy = v0+ayt and vz=v0+azt. So the resultant velocity will be v= sqrt(vx^2+vy^2+vz^2) isn't it? Is that what you mean? $\endgroup$
    – Nazerke
    Mar 30, 2013 at 3:19
  • $\begingroup$ @Nazerke Yes, that is what I meant. $\endgroup$
    – jkej
    Mar 30, 2013 at 11:42
4
$\begingroup$

You measured acceleration in three dimensions, by having measured the x, y, and z components. You need always three parameter to describe it. If you have the magnitude of the acceleration, you need two angular coordinates to define the full vector.

Only in one dimension you can talk about sign, this pointing left or right. In three dimensions, you get more parameters.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.