fractals

Understanding recursive Koch Snowflake function in Postscript

十年热恋 提交于 2019-12-02 04:29:01
问题 I have followiong program in PostScript which I am having difficutly in understanding. /kochR { 2 copy ge {dup 0 rlineto} { 3 div 2 copy kochR 60 rotate 2 copy kochR -120 rotate 2 copy kochR 60 rotate 2 copy kochR } ifelse pop pop } def 0 0 moveto 27 81 kochR 0 27 moveto 9 81 kochR 0 54 moveto 3 81 kochR 0 81 moveto 1 81 kochR stroke My questions on above program are: What does 2 copy ge { dup 0 rlineto } mean here? How does ifelse work here and what is the condition? What does 3 div do here?

Understanding recursive Koch Snowflake function in Postscript

最后都变了- 提交于 2019-12-02 01:39:31
I have followiong program in PostScript which I am having difficutly in understanding. /kochR { 2 copy ge {dup 0 rlineto} { 3 div 2 copy kochR 60 rotate 2 copy kochR -120 rotate 2 copy kochR 60 rotate 2 copy kochR } ifelse pop pop } def 0 0 moveto 27 81 kochR 0 27 moveto 9 81 kochR 0 54 moveto 3 81 kochR 0 81 moveto 1 81 kochR stroke My questions on above program are: What does 2 copy ge { dup 0 rlineto } mean here? How does ifelse work here and what is the condition? What does 3 div do here? What does the 2 copy KochR statement perform here? What does 2 copy ge { dup 0 rlineto } mean here? As

extending mandelbrot to generate julia

℡╲_俬逩灬. 提交于 2019-12-01 14:03:53
working on a project requiring me to use same code ,note in the same file to generate mandelbrot set and julia sets ,i hav a working mandelbrot set but can see how to extend to julia set using same code. maybe am not getting the differences between ? can anyone elaborate import numpy as np import matplotlib.pyplot as plt import math def Mandelbrot(zmin, zmax, m, n, tmax=256): xs = np.linspace(zmin, zmax, n) ys = np.linspace(zmin, zmax, m) X, Y = np.meshgrid(xs, ys) Z = X + 1j * Y C = np.copy(Z) M = np.ones(Z.shape) * tmax for t in xrange(tmax): mask = np.abs(Z) <= 2. Z[ mask] = Z[mask]**2 + C

extending mandelbrot to generate julia

╄→尐↘猪︶ㄣ 提交于 2019-12-01 12:58:07
问题 working on a project requiring me to use same code ,note in the same file to generate mandelbrot set and julia sets ,i hav a working mandelbrot set but can see how to extend to julia set using same code. maybe am not getting the differences between ? can anyone elaborate import numpy as np import matplotlib.pyplot as plt import math def Mandelbrot(zmin, zmax, m, n, tmax=256): xs = np.linspace(zmin, zmax, n) ys = np.linspace(zmin, zmax, m) X, Y = np.meshgrid(xs, ys) Z = X + 1j * Y C = np.copy

Java Processing 3 PAplet in JavaFX scene as FXNode

给你一囗甜甜゛ 提交于 2019-12-01 09:42:06
I am trying to make a program for visual analyzing Fractal sets. I choose Processing 3 as drawing library and JavaFX for the user interface. There are some screenshots of the current state: My GUI: there is Launcher code: import Graphics.Canvas2D; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import processing.core.PGraphics; import java.io.IOException; public class Launcher extends Application { private static Stage primaryStage; public static void main(String[] args) { launch(args); }

Java Processing 3 PAplet in JavaFX scene as FXNode

ぃ、小莉子 提交于 2019-12-01 06:40:32
问题 I am trying to make a program for visual analyzing Fractal sets. I choose Processing 3 as drawing library and JavaFX for the user interface. There are some screenshots of the current state: My GUI: there is Launcher code: import Graphics.Canvas2D; import javafx.application.Application; import javafx.fxml.FXMLLoader; import javafx.scene.Parent; import javafx.scene.Scene; import javafx.stage.Stage; import processing.core.PGraphics; import java.io.IOException; public class Launcher extends

Having trouble calculating mandelbrot set iterations

狂风中的少年 提交于 2019-12-01 04:23:28
问题 So I read up this article: http://www.wikihow.com/Plot-the-Mandelbrot-Set-By-Hand But I'm stuck at step 7. I'm drawing the set in javascript canvas. All I need is basicly the C value I guess. for (var y = 0; y < ImageHeight; y++) { for (var x = 0; x < ImageWidth; x++) { // Pixel-Position for ImageObject var xy = (x + y * image.width) * 4; // Convert Image-Dimension to a radius of 2 var xi = ((x / ImageWidth) * 4) - 2; var yi = ((y / ImageHeight) * 4) - 2; for (var n = 0; n < MaxIterations; n+

Programming Fractals [closed]

流过昼夜 提交于 2019-11-29 12:36:43
Would learning to program fractals help think clearly about certain set of programming problems? Fractal programming would introduce you to recursion, iteration, graphics programming concepts, image processing, and user interface design. From a mathematics point of view, you would learn about geometry, complex numbers, Mobius transformations (Kleinian fractals), Affine transformation (IFS fractals), root-finding methods (Newton fractals). And on top of all this, you get the reward of seeing your efforts result in strange and unusual images. From what I remember you'll get a good handle on

Calculate the Hilbert value of a point for use in a Hilbert R-Tree?

依然范特西╮ 提交于 2019-11-28 17:17:14
I have an application where a Hilbert R-Tree (wikipedia) (citeseer) would seem to be an appropriate data structure. Specifically, it requires reasonably fast spatial queries over a data set that will experience a lot of updates. However, as far as I can see, none of the descriptions of the algorithms for this data structure even mention how to actually calculate the requisite Hilbert Value ; which is the distance along a Hilbert Curve to the point. So any suggestions for how to go about calculating this? Fun question! I did a bit of googling, and the good news is, I've found an implementation

Tkinter create image function error (pyimage1 does not exist)

ぐ巨炮叔叔 提交于 2019-11-28 14:04:52
I'm a student from the outside world with no previous programming experience. I have been learning Python as an extension of my math class. I have been trying to create a program that generates fractals using Tkinter. The code works well on its own, but the inclusion of a user-input GUI causes it to give an error: Exception in Tkinter callback Traceback (most recent call last): File "C:\Python33\lib\tkinter\__init__.py", line 1475, in __call__ return self.func(*args) File "C:\Python33\FractalGUI.py", line 74, in fractals canvas.create_image((0, 0), image = img, state = "normal", anchor =