Skip to content

Commit

Permalink
force coords as integers
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastien-plutniak committed Dec 15, 2023
1 parent 9df0e26 commit a6841ac
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion R/do_objects_dataset.R
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
radians <- - degrees * pi / 180
rotated.mat <- matrix(c(cos(radians), -sin(radians), sin(radians), cos(radians)),
byrow = TRUE, ncol = 2)
t(pivot + rotated.mat %*% (t(as.matrix(coords) ) - pivot))
rotated.mat <- t(pivot + rotated.mat %*% (t(as.matrix(coords) ) - pivot))
apply(rotated.mat, 2, as.integer)
}

df[, c("x", "y")] <- rotate(df[, c("x", "y")],
Expand Down

0 comments on commit a6841ac

Please sign in to comment.