This repository has been archived on 2025-04-28. You can view files and clone it, but cannot push or open issues or pull requests.
ARPlusSystem/ARPlusSystem-250418/Assets/ARLocation/Scripts/Location/LocationReading.cs

41 lines
1.1 KiB
C#

namespace ARLocation
{
public struct LocationReading
{
public double latitude;
public double longitude;
public double altitude;
public double accuracy;
public int floor;
/// <summary>
/// Epoch time in ms
/// </summary>
public long timestamp;
public Location ToLocation()
{
return new Location(latitude, longitude, altitude);
}
public static double HorizontalDistance(LocationReading a, LocationReading b)
{
return Location.HorizontalDistance(a.ToLocation(), b.ToLocation());
}
public override string ToString()
{
return
"LocationReading { \n" +
" latitude = " + latitude + "\n" +
" longitude = " + longitude + "\n" +
" altitude = " + altitude + "\n" +
" accuracy = " + accuracy + "\n" +
" floor = " + floor + "\n" +
" timestamp = " + timestamp + "\n" +
"}";
}
}
}