Commit 330a26fa authored by luroth's avatar luroth
Browse files

Fixing wrong flight direction if flight direction point is east of edge1

parent 453ca572
......@@ -644,7 +644,7 @@ server_ <- function(input, output, session) {
start_line <- as.data.frame(spTransform(xy, CRS(paste0("+proj=utm +zone=", UTM_zone, " +ellps=WGS84"))))
# calculate orientation
theta = atan((start_line$Y[2] - start_line$Y[1]) / ( start_line$X[2] - start_line$X[1] ))
theta = atan2((start_line$Y[2] - start_line$Y[1]), ( start_line$X[2] - start_line$X[1] )) - pi
# roation matrix
rotation_matrix <- matrix(c(cos(theta), sin(theta), -sin(theta), cos(theta)), ncol=2)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment