Private
Public Access
1
0

better kml export

This commit is contained in:
2024-02-28 14:05:10 +01:00
parent eb126856a7
commit af1adf132e
7 changed files with 211 additions and 14 deletions

View File

@@ -312,6 +312,31 @@ def geo_distance(lat1, lon1, lat2, lon2):
return [distance, bearing]
def move_one_meter(latitude, longitude, bearing):
# Earth radius in meters
earth_radius = 6371000
# Convert latitude and longitude from degrees to radians
lat_rad = math.radians(latitude)
lon_rad = math.radians(longitude)
# Convert bearing from degrees to radians
bearing_rad = math.radians(bearing)
# Calculate the new latitude
new_lat = math.asin(math.sin(lat_rad) * math.cos(1/earth_radius) +
math.cos(lat_rad) * math.sin(1/earth_radius) * math.cos(bearing_rad))
# Calculate the new longitude
new_lon = lon_rad + math.atan2(math.sin(bearing_rad) * math.sin(1/earth_radius) * math.cos(lat_rad),
math.cos(1/earth_radius) - math.sin(lat_rad) * math.sin(new_lat))
# Convert new latitude and longitude from radians to degrees
new_lat = math.degrees(new_lat)
new_lon = math.degrees(new_lon)
return new_lat, new_lon
def isbreakthrough(delta, cpvalues, p0, p1, p2, p3, ratio):
pwr = abs(p0)/(1+(delta/abs(p2)))