Question about degrees in 3D space

Thread Starter

krow

Joined May 25, 2010
49
I hope you guys understand the question, it might be a little confusing, or maybe too easy to answer.

I'm working on a school project with an accelerometer and a microcontroller and one of the things I'm trying to do is to display the angles on the X,Y and Z axis as I tilt the accelerometer in different directions, I'll be using Java for that.

I managed to convert the readings from the accelerometer by mapping the values into degrees (eg. 355-522 -----> 0 - 90 degrees). I only knew how to do it with the readings from the X and Y axis, however, having the X and Y values in degrees, is there anyway I can calculate Z ?
 

victorhugo289

Joined Aug 24, 2010
49
I might be accused of not being of much help here, I hope somebody helps you with your specific problem.
With X,Y axis you write this coordinates: (x,y) and it creates a right triangle on the plane, right? ok.
With x,y,z coordinates you write this: (x,y,z) and it creates the same right triangle on the plane but it goes UP. The hypotenuse goes up in the air! :D

I know that because I know Autocad a little bit.

Rectangular coordinates (3,4) create a right triangle on the plane. ok
Polar coordinates (5, 53.13 deg) create the hypotenuse of that triangle.

I hope somebody can help you, :D

Ah yeah, learn to use Autocad and you'll master this issue. It's easy.
 

Kermit2

Joined Feb 5, 2010
4,162
I can't think of anyway to do a 3D position sensor without having a very accurate time base and an easy means of allowing for calibration by the user.

Since the main function is to detect a RATE of change. You will have to know the direction in which the sensor moves. The amount of time the move takes to complete. The speeds at which this occurs will be constantly varying.

Getting a 2 D orientation is a good start. Having a second 2D orientation in a perpendicular plane would be a bare minimum requirement. From these TWO data streams you can get a direction vector in 3 dimensions for the orientation of your device. This vector will be the direction of movement of your device in reference to another static inertial frame(usually the earth). The third axis output of your device will give you velocity(derived from the acceleration value). The math at this point will get very complex, since you have to constantly calculate direction and the various speeds at which you move against the static 3D reference frame. This is why I suggest you have the ability to easily calibrate the unit, and also a quick and easy 'button' to set a new 'zero position'. Complicated setups and calibration procedures will frustrate a user, since this unit is likely to be dropped, bumped and otherwise become confused in its constant orientation, velocity and position calculation updates. It is very do-able, but it might be impossible to maintain a long term uniterrupted '3D position' data stream that stays accurate. Eventually your device would indicate some ridiculous 'position' in space as it loses small steps here and there in calculations and from compounded errors.

Feeling all GUNG HO about this yet? :)
 
Top