## Acceleration / Orientation Visual Reference

Basic Tutorials concerning: GUI, Views, Activites, XML, Layouts, Intents, ...

### Acceleration / Orientation Visual Reference

I don't know about anyone else here but I'm more a hands on kinda person when it comes to doing things. I can read documentation until my eyes fall out and a lot of times I just won't get it until I see it or do it. Keep in mind before I started Android development I was already familiar with the basics of 3D game development - translation and transformation. And really that's exactly what acceleration and orientation mean, I just wasn't getting it because of the different terminology.

Orientation is just a rotation transformation while acceleration is the amount of force that caused a transformation. To understand lets look at transformations. On it's simplest level a transformation is changing a 3D object by either rotation (ie: in this case abstracted by the term "Orientation") or scaling. A translation is the movement of an object in 3D space from one coordinate to another.

In its simplistic form Orientation is what it says it is - how the device is oriented around it's X/Y/Z coordinate and is expressed in three angles: azimuth, pitch, and roll. To see this illustrated lay your phone flat on the table.

Azimuth represents the angle between true north and the top of the phone. So if the top is pointing towards the north the angle is 0. If the top of the phone is pointing south the angle is 180. This angle is always measured 0-359 (ie: 360 degrees).

Pitch is rotation around the X axis and is measured -180 to 180 in degrees. To illustrate lay your phone flat on the table with the top facing away (ie: normal use). This is 0 degrees. Now grab the phone at the bottom by the sides and flip it away from you. The pitch will increase positively until it is face down at 180 degrees. However if you had grabbed the top and flipped it towards you the pitch will degrees negatively.

Roll is a little trickier since it's not measured in any sense at a full 360 degrees. In fact it only measures 180 degrees of motion ranging from -90 to 90. Using our example of the phone laying flat on the table we are now going to flip it side to side instead of front to back. Thats's simple roll. If the phone is face up rolling to the left returns 0 to 90 while rolling to the right returns 0 to -90.

So what happens when the roll exceeds 90 degrees in either direction? At that point the device is considered face down and the measurement are the same but measured from that perspective. So for example if you're monitoring the angle and you're rolling to the right (ie: negative angle). You'll notice once you exceed -90 the angle will start increasing back towards 0. This is because zero degrees now represents the phone face down.

You can check if the phone is face down by checking the pitch value. If the pitch is a positive value the roll is measuring from a face down position. If pitch is negative roll is measuring from a face up position.

Acceleration on the other hand simply measures the force of a translation in one of X Y or Z directions. It has absolutely nothing to do with orientation. Nor does it measure the force in change of orientation.

To illustrate lay your phone flat on the table again. Sliding it across the table left or right results in force along the X axis. Pushing it to the right yields a positive force while sliding to the left yields negative force.

The same is true for the Y axis. Pushing the phone away yields a positive Y axis force while sliding it towards you gives a negative Y axis force.

If you lift the phone off the table you'll get positive force along the Z axis. While putting the phone back down on the table returns a negative force on the Z axis.

The faster or slower you do these actions determines the amount of force applied. Fast movement results in larger numbers while slow movements yield smaller numbers.

I put the above two illustrations together because sometimes it helps in the visualization. Most of the information though can be found in the Android documentation with just a little digging. So instead of digging just point your browsers here: http://developer.android.com/reference/ ... Event.html

Hope all this was helpful and maybe clear up some of the confusion I've seen with Orientation and Acceleration.

-TM
You wouldn't by any chance have any silver bullets?

Terrormaster
Junior Developer

Posts: 17
Joined: Tue Feb 02, 2010 7:29 pm
Location: New England

### Re: Acceleration / Orientation Visual Reference

about instructions to select appropriate footwear. Rather, I wish to pinpoint the subject associated with where you can purchase and the way to select Replica Handbags bag. This really is a difficult factor to achieve, however they do it by totally duplicating how the bag is created. Whether or not it be style, ma rolex replica e to put lower for any watch that’s in the end, merely a replica; but it is vital that you remember that when you are referring to the replica of the Imitations Watches omment, 1 eye also started to collect inside a youthful lady having a the world’s biggest luxurious items group around the lawsuit in between louis vuitton replica watches uk sociated with bulk populace. They are accessible, which replica watches are available in just about all accessible versions. swiss replica watches al benefit of elevation where you receive the actual opportunity to be in a position to consider the globe from the various viewpoint. Which is not l Replica Watches ecome inexpensive for everyone and also at reduced finances. You’ll find a myriad of replica footwear as well as replica wrist watches on the internet replica watches uk the Steven Sprouse graffiti louis vuitton paris deals towards the most current using the Japanese modern artist Takashi Murakami brought on by co-buyin replica watches uk ys the actual styles, the actual pumps, the design of the woman’s ft surrounded inside it, the actual unique leather-based as well as add-ons onto it and als replica watches uk ason with regards to the validation for that greater prices linked to the custom totes. We’re taking a look at a scenario in which the typical cu replica watch nstance, high quality cup can be used on the actual Rolex watch and it is much more the begining proof compared to cup of the replica Rolex watch. The replica watches don, just in to the LV brand has issued a set of clothes, in addition footwear. The romantic relationship in between the spotlight simply because the shops, chanel handbags ce in Asia, mainly China. Only motion could be created in Switzerland. Stating that replicas are created in Switzerland or Italy is really a lie meant to extr swiss replica watches onsiderably a lot more than regular purses is incorporated in the proven fact that the first kind are usually produced from high quality (and ther Replica Handbags
kaka
Developer

Posts: 44
Joined: Wed Nov 23, 2011 9:24 am

### Re: hollister outlet

if possible I want a mail of KYAN egan and all of tfe members
thanks for all hekps

hollister
hollister uk
hollister outlet
HCO MEN
hollister914
Junior Developer

Posts: 13
Joined: Thu Jan 12, 2012 4:17 am

### Re: Acceleration / Orientation Visual Reference

shaneee
Freshman

Posts: 2
Joined: Wed Jan 11, 2012 3:37 am