How to get real north and magnetic north with getOrientation function
How to get real north and magnetic north with getOrientation function?
getOrientation function returns float[3] with bearing, pitch and roll in second parameter...
How I can calculate real north from these values?
Thank you
android orientation
add a comment |
How to get real north and magnetic north with getOrientation function?
getOrientation function returns float[3] with bearing, pitch and roll in second parameter...
How I can calculate real north from these values?
Thank you
android orientation
add a comment |
How to get real north and magnetic north with getOrientation function?
getOrientation function returns float[3] with bearing, pitch and roll in second parameter...
How I can calculate real north from these values?
Thank you
android orientation
How to get real north and magnetic north with getOrientation function?
getOrientation function returns float[3] with bearing, pitch and roll in second parameter...
How I can calculate real north from these values?
Thank you
android orientation
android orientation
asked Dec 12 '10 at 19:40
LILkillaBEELILkillaBEE
1121516
1121516
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
The first float in your array is what you want to use to figure magnetic north.
For "true" north, you need to use GeomagneticField.getDeclination(). You have to initialize that class with the approximate location (network-provided is sufficient).
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
add a comment |
I am not sure this is the right answer, but my guess is that you will only be able to get the magnetic north because that's what the compass will give you.
To "calculate" the true north, you will need your (or the phone's) location and then map that to find the right deviation. You could use some online tool or maybe based on maps you can try to have some simple formula to compute it... (can work if you target it to a specific area).
Couple of notes also...
- It will not be too precise anyway, you will always have errors introduced by the variation which is caused by the environment of the compass.
- The difference between true and magnetic north changes constantly... not very fast, but over a couple of years, you'll definitely have a difference (depends how accurate you want to be)
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4423597%2fhow-to-get-real-north-and-magnetic-north-with-getorientation-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
The first float in your array is what you want to use to figure magnetic north.
For "true" north, you need to use GeomagneticField.getDeclination(). You have to initialize that class with the approximate location (network-provided is sufficient).
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
add a comment |
The first float in your array is what you want to use to figure magnetic north.
For "true" north, you need to use GeomagneticField.getDeclination(). You have to initialize that class with the approximate location (network-provided is sufficient).
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
add a comment |
The first float in your array is what you want to use to figure magnetic north.
For "true" north, you need to use GeomagneticField.getDeclination(). You have to initialize that class with the approximate location (network-provided is sufficient).
The first float in your array is what you want to use to figure magnetic north.
For "true" north, you need to use GeomagneticField.getDeclination(). You have to initialize that class with the approximate location (network-provided is sufficient).
answered Jun 23 '11 at 14:41
Pierre-Luc PaourPierre-Luc Paour
1,3841318
1,3841318
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
add a comment |
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Isn't that the 'old way' to get north?
– LILkillaBEE
Jun 24 '11 at 15:57
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
Old? Are you referring to the Orientation sensor? The GeomagneticField class is not deprecated, and it doesn't on its own interact with the sensors, but it does provide data based on models of the shape of the magnetic field for a given lat,lon.
– Pierre-Luc Paour
Jun 27 '11 at 7:24
add a comment |
I am not sure this is the right answer, but my guess is that you will only be able to get the magnetic north because that's what the compass will give you.
To "calculate" the true north, you will need your (or the phone's) location and then map that to find the right deviation. You could use some online tool or maybe based on maps you can try to have some simple formula to compute it... (can work if you target it to a specific area).
Couple of notes also...
- It will not be too precise anyway, you will always have errors introduced by the variation which is caused by the environment of the compass.
- The difference between true and magnetic north changes constantly... not very fast, but over a couple of years, you'll definitely have a difference (depends how accurate you want to be)
add a comment |
I am not sure this is the right answer, but my guess is that you will only be able to get the magnetic north because that's what the compass will give you.
To "calculate" the true north, you will need your (or the phone's) location and then map that to find the right deviation. You could use some online tool or maybe based on maps you can try to have some simple formula to compute it... (can work if you target it to a specific area).
Couple of notes also...
- It will not be too precise anyway, you will always have errors introduced by the variation which is caused by the environment of the compass.
- The difference between true and magnetic north changes constantly... not very fast, but over a couple of years, you'll definitely have a difference (depends how accurate you want to be)
add a comment |
I am not sure this is the right answer, but my guess is that you will only be able to get the magnetic north because that's what the compass will give you.
To "calculate" the true north, you will need your (or the phone's) location and then map that to find the right deviation. You could use some online tool or maybe based on maps you can try to have some simple formula to compute it... (can work if you target it to a specific area).
Couple of notes also...
- It will not be too precise anyway, you will always have errors introduced by the variation which is caused by the environment of the compass.
- The difference between true and magnetic north changes constantly... not very fast, but over a couple of years, you'll definitely have a difference (depends how accurate you want to be)
I am not sure this is the right answer, but my guess is that you will only be able to get the magnetic north because that's what the compass will give you.
To "calculate" the true north, you will need your (or the phone's) location and then map that to find the right deviation. You could use some online tool or maybe based on maps you can try to have some simple formula to compute it... (can work if you target it to a specific area).
Couple of notes also...
- It will not be too precise anyway, you will always have errors introduced by the variation which is caused by the environment of the compass.
- The difference between true and magnetic north changes constantly... not very fast, but over a couple of years, you'll definitely have a difference (depends how accurate you want to be)
edited Nov 21 '18 at 6:51
Project
358320
358320
answered Dec 12 '10 at 19:56
MatthieuMatthieu
13k85082
13k85082
add a comment |
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f4423597%2fhow-to-get-real-north-and-magnetic-north-with-getorientation-function%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown