Guest User

Untitled

a guest
Feb 21st, 2018
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. def self.position_convert(pos)
  2. lat = pos.latitude
  3. lng = pos.longitude
  4.  
  5. lat = (lat * 0xffffff) + 90
  6. puts lat
  7.  
  8. bytes = []
  9. bytes << lat % 256
  10. bytes << (lat % 256**2) - bytes[0]
  11. bytes << lat - bytes[0] - bytes[1]
  12. y bytes
  13. bytes.pack('a3a3')
  14. end
Add Comment
Please, Sign In to add comment