From ee4ba42fc8ddaba41f551fb543addebaf6fb221c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C3=B1o=20Sempere?= Date: Thu, 12 Dec 2019 11:19:45 +0100 Subject: [PATCH 1/2] Update geocentric.R --- maths-prog/geocentric.R | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/maths-prog/geocentric.R b/maths-prog/geocentric.R index ebc466e..e914743 100644 --- a/maths-prog/geocentric.R +++ b/maths-prog/geocentric.R @@ -7,18 +7,16 @@ sun = function(t){ return(c(x,y)) } -sun(t) d = list() d$x = c() d$y = c() - for(t in c(1:2000)){ p_sun = sun(t) d$x=c(d$x,p_sun[1]) d$y=c(d$y, p_sun[2]) } - d= as.data.frame(d) + blank = theme_void() + theme(legend.position="none") ggplot(data = d)+ geom_point(aes(x=x, y=y), size = 0.0001)+ From 1769182cf64ef979af5ab24c3d71f8256b09ddfb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nu=C3=B1o=20Sempere?= Date: Thu, 12 Dec 2019 11:27:19 +0100 Subject: [PATCH 2/2] Update geocentric.R --- maths-prog/geocentric.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/maths-prog/geocentric.R b/maths-prog/geocentric.R index e914743..eb68fa4 100644 --- a/maths-prog/geocentric.R +++ b/maths-prog/geocentric.R @@ -1,7 +1,7 @@ install.packages("ggplot2") library(ggplot2) -sun = function(t){ +circle = function(t){ x = sin(t) y = cos(t) return(c(x,y)) @@ -11,9 +11,9 @@ d = list() d$x = c() d$y = c() for(t in c(1:2000)){ - p_sun = sun(t) - d$x=c(d$x,p_sun[1]) - d$y=c(d$y, p_sun[2]) + p_circle = circle(t) + d$x=c(d$x,p_circle[1]) + d$y=c(d$y, p_circle[2]) } d= as.data.frame(d)