Difference between revisions of "GoldenRatio.R"

From Organic Design wiki
m
 
m
 
Line 1: Line 1:
 +
# {{R}}
 
options(digits=22)
 
options(digits=22)
 
phi <- (1+sqrt(5))/2
 
phi <- (1+sqrt(5))/2

Latest revision as of 00:39, 6 June 2007

Code snipits and programs written in R, S or S-PLUS options(digits=22) phi <- (1+sqrt(5))/2 phi

phi2 <- (7 * pi)/(5 * exp(1)) phi2

phiCalc <- c()

x <- 1 e <- top <- bottom <- 1 for(i in 1:20) { top <- top*x bottom <- bottom*i e <- e + top/bottom phiCalc[i] <- (7 * pi)/(5 * e) }


print(phi-phi2) print(pi) print(exp(1)) print(phiCalc - phi)