diff --git a/R/generateSierpinski.R b/R/generateSierpinski.R index b09ad86..4092420 100644 --- a/R/generateSierpinski.R +++ b/R/generateSierpinski.R @@ -17,7 +17,7 @@ generateSierpinski <- function(rows) { # n: number of vertices (e.g. n=3: Triangle) # Return a vector of length 2 with x and y coordinates sampleVertex <- function(n) { - c(x=0, y=0) + c(x=1, y=1) } # Create a point that is a step from `from` to `to` @@ -27,5 +27,5 @@ sampleVertex <- function(n) { # * step.size = 1 --> end up at `to` # * step.size = 0.5 --> halfway between `from` and `to` stepToVertex <- function(from, to, step.size) { - c(x=0, y=0) + from * (1 - step.size) + to * step.size } \ No newline at end of file