Created
January 24, 2018 14:55
-
-
Save dz1984/976dd1a5b9276ab9f94c6c6deaab8d0f to your computer and use it in GitHub Desktop.
魏爾斯特拉斯函數(Weierstrass function)是一類處處連續而處處不可導的實值函數。 https://imgur.com/w9RNrxO
This file contains 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 characters
# Weierstrass function | |
# Ref - https://zh.wikipedia.org/wiki/魏尔斯特拉斯函数 | |
g = function(x) unlist(Map(function(n) 0.5^n * cos(3^n * pi * x),seq(0,644))) | |
f = function(x) Reduce(function (x, y) x+y, g(x)) | |
x = seq(-2,2,0.001) | |
plot(x,lapply(x,f),type='l') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment