LocationReading.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. namespace ARLocation
  2. {
  3. public struct LocationReading
  4. {
  5. public double latitude;
  6. public double longitude;
  7. public double altitude;
  8. public double accuracy;
  9. public int floor;
  10. /// <summary>
  11. /// Epoch time in ms
  12. /// </summary>
  13. public long timestamp;
  14. public Location ToLocation()
  15. {
  16. return new Location(latitude, longitude, altitude);
  17. }
  18. public static double HorizontalDistance(LocationReading a, LocationReading b)
  19. {
  20. return Location.HorizontalDistance(a.ToLocation(), b.ToLocation());
  21. }
  22. public override string ToString()
  23. {
  24. return
  25. "LocationReading { \n" +
  26. " latitude = " + latitude + "\n" +
  27. " longitude = " + longitude + "\n" +
  28. " altitude = " + altitude + "\n" +
  29. " accuracy = " + accuracy + "\n" +
  30. " floor = " + floor + "\n" +
  31. " timestamp = " + timestamp + "\n" +
  32. "}";
  33. }
  34. }
  35. }