蠍一豺 z = (螳 - 蠏) / 譴ク谿 ク谿豺 t = 10z +50 -> ク谿豺襦 Slope襯 蟲れ 螳 = ATan(Slope) * 180/Pie;
angle <- atan(3/36) * (180/pi)
angle <- function(x,y){ dot.prod <- x%*%y norm.x <- norm(x,type="2") norm.y <- norm(y,type="2") theta <- acos(dot.prod / (norm.x * norm.y)) as.numeric(theta) } x <- as.matrix(c(2,1)) y <- as.matrix(c(1,2)) angle(t(x),y) # Use of transpose to make vectors (matrices) conformable. [1] 0.6435011
x <- (1:length(y)) * (max(y) - min(y)) / length(y) m <- lm(y~x) pred <- predict(m, newdata=data.frame(x,y), interval = "predict", level=.9) agl <- atan(coef(m)[2]) * (180/pi)
A <- c(1,2,3,4,5) B <- c(6,7,8,9,10) acos(sum(A*B) / (sqrt(sum(A^2)) * sqrt(sum(B^2)))) * (180/pi)