Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/halirutan/collatzvisualization
Collatz Sequence Visualization with Kotlin and Desktop Compose
https://github.com/halirutan/collatzvisualization
compose kotlin mathematics visualization
Last synced: 22 days ago
JSON representation
Collatz Sequence Visualization with Kotlin and Desktop Compose
- Host: GitHub
- URL: https://github.com/halirutan/collatzvisualization
- Owner: halirutan
- Created: 2022-07-27T02:38:00.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2022-08-08T02:51:12.000Z (about 2 years ago)
- Last Synced: 2024-05-01T20:22:40.296Z (6 months ago)
- Topics: compose, kotlin, mathematics, visualization
- Language: Kotlin
- Homepage:
- Size: 3.67 MB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Collatz Sequence Visualization with Kotlin and Compose Desktop
This repository contains a dynamic visualization of the Collatz graph using [Kotlin](https://kotlinlang.org/) and
[Compose Multiplatform](https://www.jetbrains.com/lp/compose-mpp/).
The intention is to provide a small but not dead simple example of a complete Compose application.![Image](images/img.png)
If you don't know what Collatz sequences are or what is meant by the Collatz graph, just stare at this xkcd for a
moment:![Collatz Conjecture](https://imgs.xkcd.com/comics/collatz_conjecture.png)
Building such a graph for many numbers,
displaying them using an [angle path](https://reference.wolfram.com/language/ref/AnglePath.html), and colorizing all
lines with a [scientific color gradient](https://astron-soc.in/bulletin/11June/289392011.pdf), you will get
a visualization as shown in the first image.## Running the app
Clone the repository and run
```Bash
./gradlew run
```from a command line (on Windows it's `gradlew.bat`).
You can also open the the project in [IntelliJ IDEA](https://www.jetbrains.com/idea/) and it will import everything
automatically.
Afterwards, you can press the "play" button that should appear next to```kotlin
fun main() = application
```in [Main.kt](src/main/kotlin/Main.kt).