postgresql - Comparing orientations with Postgres/PostGIS -


i'm working on app need take orientation of user's phone (e.g. using web orientation api or otherwise), , compare stored orientation. need determine if these orientations close enough each other in terms of degrees. edit: end goal of tell when user facing in exact same direction stored in database (i.e. tilt isn't important)

so conceptually we're finding distance between 2 points on circle, these points determined 2 angles, alpha , beta, rather latitude , longitude, they're both out of 360 degrees (like this question suppose). web api returns 3 different angles alpha, beta , gamma, explained here, care alpha , beta think.

firstly, how store 3d orientation in postgres? model data point latitude , longitude, annoying have convert angle out of 360 angle out of 180 or 90). there better format store orientation in postgres?

secondly, how compare orientations? i've found function, st_distance_spheroid, compares distance between points on sphere in terms of latitude , longitude, not require converting angles latitude , longitude, requires spheroid use mapping. spheroid unit sphere? there better way this?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -