azimuth

Compare device 3D orientation with the sun position

ε祈祈猫儿з 提交于 2019-12-06 04:04:11
问题 I am working on an app that requires the user to aim his iPhone to the sun in order to trigger a special event. I can retrieve the device 3D orientation quaternion based on the gyroscope and CoreMotion framework, from this I can get the yaw, roll and pitch angles. I can also compute the sun's azimuth and zenith angle based on the current date and time (GMT) and the latitude and longitude. What I am trying to figure out next is how to compare these two sets of values (phone orientation and sun

How to get the compass direction from azimuth on Android

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-06 01:46:13
问题 I have to display which direction the user is pointing the Android device. I am using Sensor.TYPE_ACCELEROMETER , Sensor.TYPE_MAGNETIC_FIELD to get the azimuth, pitch, roll. But I am to able to figure out how to get directions (North, south, east , west,...) from this. Please help Thanks 回答1: To point the north you can calculate a rotation in degrees : float rotation = -azimut * 360 / (2 * 3.14159f); You can see the following compass example which make uses of accelerometer and magnetic field

Python PyEphem calculation of Azimuth and Altitude

情到浓时终转凉″ 提交于 2019-12-05 15:22:37
I am new to PyEphem and I am trying to figure out what it can do and how it works. As I do not want to use it as a black box and blindly trust whatever figure I get, I wanted to recreate an example that is explained here . The example calculates the azimuth and altitude of an object for a given observer on the 10th August 1998 at 23:10 UT. The following parameters are given: RA = 16 h 41.7 min, DEC = 36 d 28 min The observer's latitude is 52 d 30 min North and longitude 1 d 55 min West. The correct answer according to the example (which I can recreate in Excel) is AZ = 269.14634 degrees and

Position of the sun given time of day, latitude and longitude - EDIT

半世苍凉 提交于 2019-12-05 04:10:05
问题 This question has been asked before two times. In 2012, Position of the sun given time of day, latitude and longitude, Josh O'Brien gave a new version of the function sunPosition: sunPosition <- function(year, month, day, hour=12, min=0, sec=0, lat=46.5, long=6.5) { twopi <- 2 * pi deg2rad <- pi / 180 # Get day of the year, e.g. Feb 1 = 32, Mar 1 = 61 on leap years month.days <- c(0,31,28,31,30,31,30,31,31,30,31,30) day <- day + cumsum(month.days)[month] leapdays <- year %% 4 == 0 & (year %%

Compare device 3D orientation with the sun position

假如想象 提交于 2019-12-04 10:24:43
I am working on an app that requires the user to aim his iPhone to the sun in order to trigger a special event. I can retrieve the device 3D orientation quaternion based on the gyroscope and CoreMotion framework, from this I can get the yaw, roll and pitch angles. I can also compute the sun's azimuth and zenith angle based on the current date and time (GMT) and the latitude and longitude. What I am trying to figure out next is how to compare these two sets of values (phone orientation and sun position) to accurately detect the alignment of the device with the sun. Any ideas on how to achieve

How to get the compass direction from azimuth on Android

点点圈 提交于 2019-12-04 06:37:31
I have to display which direction the user is pointing the Android device. I am using Sensor.TYPE_ACCELEROMETER , Sensor.TYPE_MAGNETIC_FIELD to get the azimuth, pitch, roll. But I am to able to figure out how to get directions (North, south, east , west,...) from this. Please help Thanks To point the north you can calculate a rotation in degrees : float rotation = -azimut * 360 / (2 * 3.14159f); You can see the following compass example which make uses of accelerometer and magnetic field : http://www.codingforandroid.com/2011/01/using-orientation-sensors-simple.html Azimuth on Wikipédia : http

Position of the sun given time of day, latitude and longitude - EDIT

ⅰ亾dé卋堺 提交于 2019-12-03 21:57:10
This question has been asked before two times. In 2012, Position of the sun given time of day, latitude and longitude , Josh O'Brien gave a new version of the function sunPosition: sunPosition <- function(year, month, day, hour=12, min=0, sec=0, lat=46.5, long=6.5) { twopi <- 2 * pi deg2rad <- pi / 180 # Get day of the year, e.g. Feb 1 = 32, Mar 1 = 61 on leap years month.days <- c(0,31,28,31,30,31,30,31,31,30,31,30) day <- day + cumsum(month.days)[month] leapdays <- year %% 4 == 0 & (year %% 400 == 0 | year %% 100 != 0) & day >= 60 & !(month==2 & day==60) day[leapdays] <- day[leapdays] + 1 #

Position of the sun given time of day, latitude and longitude

大城市里の小女人 提交于 2019-11-26 21:26:58
This question has been asked before a little over three years ago. There was an answer given, however I've found a glitch in the solution. Code below is in R. I've ported it to another language, however have tested the original code directly in R to ensure the issue wasn't with my porting. sunPosition <- function(year, month, day, hour=12, min=0, sec=0, lat=46.5, long=6.5) { twopi <- 2 * pi deg2rad <- pi / 180 # Get day of the year, e.g. Feb 1 = 32, Mar 1 = 61 on leap years month.days <- c(0,31,28,31,30,31,30,31,31,30,31,30) day <- day + cumsum(month.days)[month] leapdays <- year %% 4 == 0 &

Position of the sun given time of day, latitude and longitude

浪子不回头ぞ 提交于 2019-11-26 12:18:08
问题 This question has been asked before a little over three years ago. There was an answer given, however I\'ve found a glitch in the solution. Code below is in R. I\'ve ported it to another language, however have tested the original code directly in R to ensure the issue wasn\'t with my porting. sunPosition <- function(year, month, day, hour=12, min=0, sec=0, lat=46.5, long=6.5) { twopi <- 2 * pi deg2rad <- pi / 180 # Get day of the year, e.g. Feb 1 = 32, Mar 1 = 61 on leap years month.days <- c