What I am trying to do?
Using the sensor of Android, I have collected lot of acceleration values when some diabetic patients were running to do physical
You can get the direction just by using simple math- y/x=tan theta, where theta is the angle from origin in the xy plane. Similar math can get you the other angle involved. The problem for you is all that is relative to the phone, not to the user. So if his phone was at an angle in his pocket, you won't get the answers you want. Worse if it was upside down.
That said- I question the actual need for this. If you're trying to get relative effort of their exercising, magnitude should be enough. If you're trying to do something like mapping, acceleration data is too noisy for accuracy.