Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Snowflake curve
# Construção da curva de Koch. it <- function(z){ # Iteração base p=matrix(0,2,5);u=z[,2]-z[,1]; t=pi/3 M=matrix(c(cos(t),sin(t),-sin(t),cos(t)),2,2) p[,1]=z[,1];p[,2]=z[,1]+u/3 p[,3]=p[,2]+M%*%(u/3);p[,4]=z[,2]-u/3; p[,5]=z[,2];p} SnowFlake<-function(x,y,m){ # Replicação da iteração base. t=pi/3 M=matrix(c(cos(t),sin(t),-sin(t),cos(t)),2,2) z=matrix(c(x,x+M%*%(y-x),y,x),2,4) for ( i in 1:m){ q=matrix(0,2,4*length(z[1,])-3) for (j in 1:(length(z[1,])-1)){ q[,(4*j-3):(4*(j+1)-3)]=it(z[,j:(j+1)])} z=q};z } # --- Teste ----------------------------------- x=c(0,1) y=c(1,2) z=matrix(c(x,y),2,2) plot(x,y,'l') # Teste z=it(z);z plot(z[1,],z[2,],'l') z=SnowFlake(x,y,6); plot(z[1,],z[2,],'l',axes=FALSE,col="red")
run
|
edit
|
history
|
help
0
Call option formula for Laplace distributed outcomes
marian
Phylotaxis in R
Ch. 5: Cookie Chip Sampling - Idealized
ExDecaiEulerMin24-02-21
CRR convergence
Graph
Mann Whitney wilcoxon test
cool ggplot
Ass2 q2