Created
March 7, 2022 03:41
-
-
Save clauswilke/6d10f1d58fb3da62da9057b418fa191c to your computer and use it in GitHub Desktop.
Revisions
-
clauswilke created this gist
Mar 7, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,30 @@ # Deterministically generated normal variates, implemented here in R but more # useful for GLSL programming. library(ggplot2) fract <- function(x) x - floor(x) rand <- function(x) fract(3482954.234 * sin(24934.342 * x + 12394.32)) norm <- function(x) { (rand(x) + rand(x + 17) + rand(x + 234) + rand(x + 456) + rand(x + 542) + rand(x + 586) + rand(x + 601) + rand(x + 723) + rand(x + 869) + rand(x + 901) + rand(x + 932) + rand(x + 998) - 6) } df <- data.frame( x = norm(1:10000), y = norm(10001:20000) ) df2 <- data.frame( x = rnorm(10000), y = rnorm(10000) ) ggplot(df, aes(x, y)) + geom_point(size = .1) + theme_bw() ggplot(df2, aes(x, y)) + geom_point(size = .1) + theme_bw() shapiro.test(df$x[1:4000])