From d4b671695f1821e377036329fd9427f0a5054602 Mon Sep 17 00:00:00 2001 From: Nuno Date: Thu, 12 Dec 2019 11:14:40 +0100 Subject: [PATCH] Geocentric model --- maths-prog/geocentric.R | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 maths-prog/geocentric.R diff --git a/maths-prog/geocentric.R b/maths-prog/geocentric.R new file mode 100644 index 0000000..ebc466e --- /dev/null +++ b/maths-prog/geocentric.R @@ -0,0 +1,28 @@ +install.packages("ggplot2") +library(ggplot2) + +sun = function(t){ + x = sin(t) + y = cos(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)+ + blank + +ggsave("temp.png", width = 30, height = 30, units = "cm") +