Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8263597
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:09:49+00:00 2026-06-08T04:09:49+00:00

From my Android device I can read an array of linear acceleration values (in

  • 0

From my Android device I can read an array of linear acceleration values (in the device’s coordinate system) and an array of absolute orientation values (in Earth’s coordinate system). What I need is to obtain the linear acceleration values in the latter coord. system.

How can I convert them?

EDIT after Ali’s reply in comment:

All right, so if I understand correctly, when I measure the linear acceleration, the position of the phone completely does not matter, because the readings are given in Earth’s coordinate system. right?

But I just did a test where I put the phone in different positions and got acceleration in different axes. There are 3 pairs of pictures – the first ones show how I put the device (sorry for my Paint “master skill”) and the second ones show readings from data provided by the linear acc. sensor:

  1. device put on left side

first position
first readings

  1. device lying on back

second position
second readings

  1. device standing

enter image description here
enter image description here

And now – why in the third case the acceleration occurs along the Z axis (not Y) since the device position doesn’t matter?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-08T04:09:51+00:00Added an answer on June 8, 2026 at 4:09 am

    I finally managed to solve it! So to get acceleration vector in Earth’s coordinate system you need to:

    1. get rotation matrix (float[16] so it could be used later by android.opengl.Matrix class) from SensorManager.getRotationMatrix() (using SENSOR.TYPE_GRAVITY and SENSOR.TYPE_MAGNETIC_FIELD sensors values as parameters),
    2. use android.opengl.Matrix.invertM() on the rotation matrix to invert it (not transpose!),
    3. use Sensor.TYPE_LINEAR_ACCELERATION sensor to get linear acceleration vector (in device’s coord. sys.),
    4. use android.opengl.Matrix.multiplyMV() to multiply the rotation matrix by linear acceleration vector.

    And there you have it! I hope I will save some precious time for others.

    Thanks for Edward Falk and Ali for hints!!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need to send some byte array from android device to Servlet. For this
Can i get all the events and other informations from android device default calendar
I need to send a http post request from my android device to a
On many Android devices you can get into a secret settings menu from Phone
I was wondering how do i take complete logs from android device (From the
How to delete all contacts number by name from android device. if number is
is it possible to transfer files from one android phone to any other device
I'm consuming a web service from an Android device using HTTP(s) with SSL. A
I see that I can retrieve CMAttitude from a device and from it I
I'm sending sensor data from an android device to a TCP server in C#.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.