_覓 | 覦覈襦 | 豕蠏手 | 殊螳 | 譯殊碁 |
FrontPage › Angle
|
|
蠍一豺 z = (螳 - 蠏) / 譴ク谿 ク谿豺 t = 10z +50 -> ク谿豺襦 Slope襯 蟲れ 螳 = ATan(Slope) * 180/Pie; x 蠍語願 36, y 蠍語願 3企朱
angle <- atan(3/36) * (180/pi) --https://stackoverflow.com/questions/1897704/angle-between-two-vectors-in-r
覦燕 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 [edit]
slope to angle #regression 蟆郁骸螳 企る..
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)
鏤
|
豕 豕螻 訖 豕螻襷 豕螻 . |