cells2numbers / migrationminer

MigrationmineR is a R package to analyse and profile in vitro cell tracking and migration data. It is belongs to the cytominer-verse used for morphological profiling and allows to create temporal or dynamic profiles.
Other
5 stars 0 forks source link

plot_windrose shows wrong x direction #25

Closed cells2numbers closed 5 years ago

cells2numbers commented 5 years ago

Sample code

library(tidyverse)
library(migrationminer)

x = c(1,100,-2)
y = c(1,-200,1)

Track_Angle =
  atan2(tail(y, n = 1) - (y)[1],
        tail(x, n = 1) - (y)[1]
  ) %>% print

(Track_Angle >= pi / 4) &  (Track_Angle < 3 * pi / 4 )

# test windroseplot 

# up 1.5 
# down -1.5
# left 3 
# right 0

tracks <- tibble(Track_Angle = -c(-1.5, 3, -1.5, 3), Track_Speed = c(1,1,1,1), id = c(1,1,1,1))

plot_windrose(tracks)