Skip to content

Commit

Permalink
Issue #48 Split Mandelbrot-Tab into Mandelbrot-Julia and Mandelbrot-Zoom
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaswoehlke committed Oct 10, 2020
1 parent d55ac9c commit 28e9278
Show file tree
Hide file tree
Showing 103 changed files with 2,690 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<relativePath>..</relativePath>
</parent>

<artifactId>insourcing-mandelbrot</artifactId>
<artifactId>insourcing-mandelbrot-switch</artifactId>
<packaging>jar</packaging>

<name>single-apps :: insourcing :: Mandelbrot</name>
<name>single-apps :: insourcing :: Mandelbrot :: Switch</name>
<description>Computing the Edge of the Mandelbrot Set with a Turing Machine</description>

<properties>
<applicationMainClass>org.woehlke.computer.kurzweil.cyclic.cellular.automaton.CyclicCellularAutomatonApplication</applicationMainClass>
<applicationMainClass>org.woehlke.computer.kurzweil.MandelbrotSwitchApplication</applicationMainClass>
</properties>

<dependencies>
Expand Down Expand Up @@ -99,7 +99,7 @@
</execution>
</executions>
<configuration>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotApplication</mainClass>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotSwitchApplication</mainClass>
</configuration>
</plugin>
<plugin>
Expand All @@ -109,7 +109,7 @@
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotApplication</mainClass>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotSwitchApplication</mainClass>
</manifest>
</archive>
</configuration>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@


function site() {
../../../mvnw -e clean install site site:deploy
../../../mvnw -e site site:deploy
}

function run() {
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
package org.woehlke.computer.kurzweil;

import org.woehlke.computer.kurzweil.application.ComputerKurzweilProperties;
import org.woehlke.computer.kurzweil.tabs.mandelbrot.MandelbrotTab;

import java.io.File;
import java.net.URL;

/**
* Mandelbrot Set drawn by a Turing Machine.
*
* (C) 2006 - 2015 Thomas Woehlke.
* https://thomas-woehlke.blogspot.com/2016/01/mandelbrot-set-drawn-by-turing-machine.html
* @author Thomas Woehlke
*/
public class MandelbrotSwitchApplication {

private MandelbrotSwitchApplication() {
String configFileName = "/application.yml";
URL fileUrl = getClass().getResource(configFileName);
File configFile = new File(fileUrl.getFile());
ComputerKurzweilProperties properties = ComputerKurzweilProperties.propertiesFactory(configFile);
MandelbrotTab frame = new MandelbrotTab(properties);
}

/**
* Starting the Application.
* @param args CLI Parameter
*/
public static void main(String[] args) {
MandelbrotSwitchApplication application = new MandelbrotSwitchApplication();
}
}
11 changes: 11 additions & 0 deletions single-apps/insourcing/insourcing-mandelbrot-zoom/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Ignore Gradle project-specific cache directory
.gradle

# Ignore Gradle build output directory
build

#.idea
/.idea/workspace.xml

target
/dependency-reduced-pom.xml
72 changes: 72 additions & 0 deletions single-apps/insourcing/insourcing-mandelbrot-zoom/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
# Mandelbrot

**Computing the Edge of the Mandelbrot Set with a Turing Machine**

## Abstract: Mandelbrot Set

The Mandelbrot set is the set of values of c in the complex plane for which the orbit of 0
under iteration of the complex quadratic polynomial z_(n+1)=z_n^2+c remains bounded.

That is, a complex number c is part of the Mandelbrot set if, when starting with z0 = 0
and applying the iteration repeatedly, the absolute value of zn remains bounded
however large n gets.

## The Turing Machine to Compute the Mandelbrot Set
The Complex Number Plane is divided into Cells for the two dimensional Tape of the Turing-Machine.
Starting with Complex Number of Cell right from the Mandelbrot Set the Turing Machine goes one Step to the left and computes, wether the Complex Number of the Cell is inside the Set. If not, it continues to go left.
The Turing-Machine then goes around the Set by computing wether the Complex Number of the Cell is inside the Set. If not it turns left, else it turns right. After that it goes one step forward.
After the Turing Machine finished to run around the Set, the Application paints the Inside of the Set Black und computes the Colors of the Outside.

## Julia Set
The Mandelbrot Set is drawn into the Complex Number Plane and so clicking into it, it delivers the Complex Number to calculate a Julia Set for it.
The most beautiful Julia Sets are drawn by clicking into the Border of the Mandelbrot Set.

## More
* [https://en.wikipedia.org/wiki/Mandelbrot_set](https://en.wikipedia.org/wiki/Mandelbrot_set)
* [https://en.wikipedia.org/wiki/Julia_set](https://en.wikipedia.org/wiki/Julia_set)
* [https://en.wikipedia.org/wiki/Turing_machine](https://en.wikipedia.org/wiki/Turing_machine)

## Screenshots

### Running around the Edge of the Mandelbrot Set

![Running around the Edge of the Mandelbrot Set](src/main/resources/img/screen01.png)

### Running around the Edge of the Mandelbrot Set

![Running around the Edge of the Mandelbrot Set](src/main/resources/img/screen02.png)

### Computing the Area outside the Mandelbrot Set

![Computing the Area outside the Mandelbrot Set](src/main/resources/img/screen03.png)

### Clicked somewhere on the Edge of Mandelbrot Set: The Julia Set

![Clicked somewhere on the Edge of Mandelbrot Set: The Julia Set](src/main/resources/img/julia01.png)

### Clicked on another Point on the Edge of Mandelbrot Set: The Julia Set

![Clicked on another Point on the Edge of Mandelbrot Set: The Julia Set](src/main/resources/img/julia02.png)


### Git Repository
* [https://github.com/thomaswoehlke/mandelbrot](https://github.com/thomaswoehlke/mandelbrot.git)


### Gradle Wrapper
* [https://docs.gradle.org/current/userguide/gradle_wrapper.html](https://docs.gradle.org/current/userguide/gradle_wrapper.html)

### Run the Desktop Application
```
git clone https://github.com/thomaswoehlke/mandelbrot.git
cd mandelbrot
./gradlew clean shadowJar runShadow
```

### Run the Applet Test
```
git clone https://github.com/thomaswoehlke/mandelbrot.git
cd mandelbrot
TODO: xxx
```

128 changes: 128 additions & 0 deletions single-apps/insourcing/insourcing-mandelbrot-zoom/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>

<parent>
<groupId>org.woehlke.computer.kurzweil</groupId>
<artifactId>insourcing</artifactId>
<version>2.2.8-SNAPSHOT</version>
<relativePath>..</relativePath>
</parent>

<artifactId>insourcing-mandelbrot-zoom</artifactId>
<packaging>jar</packaging>

<name>single-apps :: insourcing :: Mandelbrot :: Zoom</name>
<description>Computing the Edge of the Mandelbrot Set with a Turing Machine</description>

<properties>
<applicationMainClass>org.woehlke.computer.kurzweil.MandelbrotZoomApplication</applicationMainClass>
</properties>

<dependencies>

<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-slf4j-impl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-api</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-jcl</artifactId>
</dependency>
<dependency>
<groupId>org.apache.logging.log4j</groupId>
<artifactId>log4j-core</artifactId>
</dependency>

<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-properties</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-ion</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
</dependency>
<dependency>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
</dependency>
<dependency>
<groupId>javax.validation</groupId>
<artifactId>validation-api</artifactId>
</dependency>
</dependencies>

<build>
<finalName>${project.artifactId}</finalName>
<defaultGoal>clean dependency:tree install exec:java</defaultGoal>
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotZoomApplication</mainClass>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<mainClass>org.woehlke.computer.kurzweil.MandelbrotZoomApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<configuration>
<preparationGoals>clean</preparationGoals>
<autoVersionSubmodules>true</autoVersionSubmodules>
</configuration>
</plugin>
</plugins>
</build>

</project>
2 changes: 2 additions & 0 deletions single-apps/insourcing/insourcing-mandelbrot-zoom/run.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
cmd /c ..\..\mvnw -e clean install site
cmd /c ..\..\mvnw
17 changes: 17 additions & 0 deletions single-apps/insourcing/insourcing-mandelbrot-zoom/run.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/usr/bin/env bash


function site() {
../../../mvnw -e site site:deploy
}

function run() {
../../../mvnw
}

function main() {
#site
run
}

main
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@
* https://thomas-woehlke.blogspot.com/2016/01/mandelbrot-set-drawn-by-turing-machine.html
* @author Thomas Woehlke
*/
public class MandelbrotApplication {
public class MandelbrotZoomApplication {

private MandelbrotApplication() {
private MandelbrotZoomApplication() {
String configFileName = "/application.yml";
URL fileUrl = getClass().getResource(configFileName);
File configFile = new File(fileUrl.getFile());
Expand All @@ -28,6 +28,6 @@ private MandelbrotApplication() {
* @param args CLI Parameter
*/
public static void main(String[] args) {
MandelbrotApplication application = new MandelbrotApplication();
MandelbrotZoomApplication application = new MandelbrotZoomApplication();
}
}
Loading

0 comments on commit 28e9278

Please sign in to comment.