views:

235

answers:

1

Hello All,

How do i calculate Dip and Strike from iphone. They are used to measure rocks. i have to use compass api how do i get the angle from it. anyone has idea please give me some idea.

Thank you.

A: 

The "compass API" is not so much a compass as a magnetometer. (In other words, if you put your phone near some strong local magnetic field - say, a CRT monitor - you won't only be measuring the Earth's magnetic field.)

This sample ought to help you on your way. It demonstrates the use of the CLLocationManager.

To determine the orientation of the rockface you need to use the UIAccelerometer class. Have your ViewController or whatever implement the UIAccelerometerDelegate protocol. The BubbleLevel sample application will show you how to use the API.

The magnetometer then allows you to turn that phone orientation into an orientation relative to magnetic North.

Frank Shearar
I need to calculate the stone rocks, for which i use strike.
mactalent
Thank you for your help. But strike is perpendicular to north so how can i get those angle by compass?
mactalent