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 1109833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T02:18:01+00:00 2026-05-17T02:18:01+00:00

Real-life case (helps understand the question) I am building a device that can freely

  • 0

Real-life case (helps understand the question)

I am building a device that can freely rotate around all its axis (x, y, z) and is equipped with:

  • an accelerometer (A) that gives me a vector pointing to the centre of the Earth (Va)
  • a 3D magnetometer (M) that gives me the direction of the magnetic field of the Earth (Vm)

The two vectors share the same reference system (x, y, z), but what I am interested to find is the vector that points to the north relative to the Earth surface [think of a hand-held compass: I want to find where the needle should point to].

This video shows a “ball compass” that has pretty much the same behaviour that my device should replicate electronically.

The coding question

I did a bit of research, and it seems to me that I should use is 3D rotation matrices doing the following two steps:

  1. rotate the reference system of Vm from R to R’, in such a way that y’ will be parallel to Va,
  2. “flatten” the Vm vector setting its y’ component to 0

Unluckily I am still confused on how I should proceed in concrete terms (I have no previous experience of working with vectors and matrices). One of the things that confuses me is that most of the material I could google, talks in terms of angles, but the data I am receiving from both sensors is in the form V(Vx, Vy, Vz), where Vz, Vy and Vz are the components of V along the reference system.

So my question really boils down to: what is the matrix I have to use in order to perform the transformation of which at step #1?

Thank you in advance for your time and expertise.

  • 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-05-17T02:18:01+00:00Added an answer on May 17, 2026 at 2:18 am

    One simpler answer that comes to mind is to use cross products.

    you can find east with Ve = Va ⨉ Vm
    and then north with Vn = Va ⨉ Ve

    (this might actually be south, haven’t thought through the handedness)

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

Sidebar

Related Questions

Real noob question no doubt, but I can't get my head around this behaviour.
This isn't a question for a real-life project; I'm only curious. We can increase
Can the new operator throw an exception in real life? And if so, do
I have to make a mobile app that calculates the real life size of
I'll try to start with the real life example in my case: I have
I need to define a class that represents a real-life event -- like a
This may sound totally stupid, but is a case of real life :( I'm
Can anyone please give me a real life, practical example of Polymorphism? My professor
Is anyone aware of a practical (real-life) use of Ruby's DBM lib? Is it
So for example we have real life photo. how to get (relativly to image

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.