Magnetic fields, rotation matrix and global coordinates

I think I read all the posts on this, but still I can’t understand a few things:

1: To get the magnetic field vector in global coordinates, I need to multiply the inverted rotation matrix and the magnetic field vector, why do I need to invert the rotation matrix?

2: Suppose I have a device and I can calculate the azimuth based on rotation in the Z axis using the getOrientation (...) method. can I use a rotation matrix or some other method to calculate the azimuth to magnetic north, regardless of the relationship to the phone? Therefore, if I turn the phone, will the angle between me and magnetic north remain the same?

Q3: When I multiply the magnetic vector (4th pillar is zero) with the inverted rotation matrix, I get that x is very close to zero. I know this is ok from other posts, but I can't figure out why?

Q4: Theoretically, let's say that I have two devices located at a distance of 1 meter from each other, is it possible to make the spatial position of two devices based only on their magnetic fields (in global coordinates)

Thanks for the advanced.

PS I already read these messages: Getting the magnetic field values ​​in global coordinates , How can I get the magnetic field vector, regardless of the rotation of the device?

Convert X, Y, Z magnetic field values ​​from the device to the global control frame

+1
source share
2

X, Y, Z .

A1. , .

: , .

, getRotationMatrix, - . v , v .

- . , , , . , , . , , , < . .

A2. getOrientation , . . , , , , . , , , -z ( , ). , , -z - . , , -z, . getOrientation, remapCoordinateSystem(inR, AXIS_X, AXIS_Z, outR) getOrientation, .

A3. getRotationMatrix , - , North-Sky. , , , x , 0. .

A4. - . , . , , . 2 , , , .

+4

A1. . , .

2. , .

A3. x - , - . , z, .

A4. , , Android, .

+1

All Articles