i managed to get the reading of the B field to work for both the new rotated axis and the universal x and y axis.

it took a long time (but it is worth it) for me to narrow down to which code affected the reading and it was a challenge to transform the axis 2 times to get the universal x and y axis.

Thanks for your tips and wisdom!

[eye]

/htdocs/ntnujava/ejsuser/14019/users/sgeducation/lookang/MagneticBarFieldFKH_pkg/MagneticBarFieldFKH.propertiesFull screen applet or Problem viewing java?Add http://www.phy.ntnu.edu.tw/ to exception site list
Press the Alt key and the left mouse button to drag the applet off the browser and onto the desktop. This work is licensed under a Creative Commons Attribution 2.5 Taiwan License
Download EJS jar file(817.8kB):double click downloaded file to run it. , Download EJS source View EJS source

[/eye]