Calculate Dip and Strike
How do i calculate Dip and Strike from iphone. They are used to measure rocks. i have to use compass ap开发者_开发知识库i how do i get the angle from it. anyone has idea please give me some idea.
Thank you.
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.
Instead of asking the same question. I offer part but not full answer.
Strike => (Geology) horizontal surface crossing bedding in question: this can be achieved by reading the heading from the CLLocationDirection.magneticHeading
Dip.angle => (Geology) horizontal surface & bedding angle: this can be achieved by either CMMotionManager.CMDeviceMotion.CMAttitude.roll or pitch depending on how the iOS device is held to the bedding being measuered.
EDIT: 3. Dip.driection => (Geology) actual NSWE orientation of the tilt: Strike + 90 because they are perpendicular clockwise (I think).
I may have not written my answer correctly but my geologist colleagues confirm my readings which is basically 1, 2 and 3 (eg: 43/11SE)
If someone can improve this answer, I appreciate it.
精彩评论