Skip to content

Commit

Permalink
Major: update the approximation in the binary distance
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafnuss committed Nov 15, 2022
1 parent 1df06e7 commit 6f41625
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions R/graph.R
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,11 @@ graph_create <- function(static_prob,
)
lon <- utils::head(lon, -1) + diff(lon[1:2]) / 2

# Approximate resolution of the grid in km assuming 111km/lat-lon
resolution <- mean(diff(lon)) * 111
# Approximate resolution of the grid from ° to in km
# Assume uniform grid in lat-lon
# Use the smaller resolution assuming 111km/lon and 111*cos(lat)km/lat
resolution <- mean(diff(lon)) * pmin(cos(lat*pi/180)*111.320,110.574)


# extract the flight duration
flight_duration <- unlist(lapply(static_prob, function(x) {
Expand Down

0 comments on commit 6f41625

Please sign in to comment.