All Projects → gongzhang → Julia Set Playground

gongzhang / Julia Set Playground

Licence: mit
A Swift playground that generates beautiful Julia set fractal images.

Programming Languages

swift
15916 projects

Projects that are alternatives of or similar to Julia Set Playground

Calc
C-style arbitrary precision calculator
Stars: ✭ 127 (-46.19%)
Mutual labels:  math, mathematics
Playgrounds
Better playgrounds that work both for Objective-C and Swift
Stars: ✭ 2,586 (+995.76%)
Mutual labels:  playground, swift-playgrounds
Texme
Self-rendering Markdown + LaTeX documents
Stars: ✭ 1,970 (+734.75%)
Mutual labels:  math, mathematics
Project Euler Solutions
Runnable code for solving Project Euler problems in Java, Python, Mathematica, Haskell.
Stars: ✭ 1,374 (+482.2%)
Mutual labels:  math, mathematics
Stdlib
✨ Standard library for JavaScript and Node.js. ✨
Stars: ✭ 2,749 (+1064.83%)
Mutual labels:  math, mathematics
Sage
Mirror of the Sage source tree -- please do not submit PRs here -- everything must be submitted via https://trac.sagemath.org/
Stars: ✭ 1,656 (+601.69%)
Mutual labels:  math, mathematics
Math Php
Powerful modern math library for PHP: Features descriptive statistics and regressions; Continuous and discrete probability distributions; Linear algebra with matrices and vectors, Numerical analysis; special mathematical functions; Algebra
Stars: ✭ 2,009 (+751.27%)
Mutual labels:  math, mathematics
Audiokit
Swift audio synthesis, processing, & analysis platform for iOS, macOS and tvOS
Stars: ✭ 8,827 (+3640.25%)
Mutual labels:  playground, swift-playgrounds
Tutorials
AI-related tutorials. Access any of them for free → https://towardsai.net/editorial
Stars: ✭ 204 (-13.56%)
Mutual labels:  math, mathematics
Ugm
Ubpa Graphics Mathematics
Stars: ✭ 178 (-24.58%)
Mutual labels:  math, mathematics
Funmath
☔️ Implementations of mathematical functions, formulas and concepts
Stars: ✭ 93 (-60.59%)
Mutual labels:  math, mathematics
Mathmodel
研究生数学建模,本科生数学建模、数学建模竞赛优秀论文,数学建模算法,LaTeX论文模板,算法思维导图,参考书籍,Matlab软件教程,PPT
Stars: ✭ 3,834 (+1524.58%)
Mutual labels:  math, mathematics
Fermat.js
Mathematics and statistics library for TypeScript.
Stars: ✭ 74 (-68.64%)
Mutual labels:  math, mathematics
Studybook
Study E-Book(ComputerVision DeepLearning MachineLearning Math NLP Python ReinforcementLearning)
Stars: ✭ 1,457 (+517.37%)
Mutual labels:  math, mathematics
Math Toolbox
Lightweight and modular math toolbox
Stars: ✭ 71 (-69.92%)
Mutual labels:  math, mathematics
Jlatexmath Android
aJLaTeXMath Library - Displays LaTeX commands in android OS.
Stars: ✭ 147 (-37.71%)
Mutual labels:  math, mathematics
String Calc
PHP calculator library for mathematical terms (expressions) passed as strings
Stars: ✭ 60 (-74.58%)
Mutual labels:  math, mathematics
Euler
Swift Custom Operators for Mathematical Notation
Stars: ✭ 1,123 (+375.85%)
Mutual labels:  playground, math
Computator.net
Computator.NET is a special kind of numerical software that is fast and easy to use but not worse than others feature-wise. It's features include: - Real and complex functions charts - Real and complex calculator - Real functions numerical calculations including different methods - Over 107 Elementary functions - Over 141 Special functions - Over 21 Matrix functions and operations - Scripting language with power to easy computations including matrices - You can declare your own custom functions with scripting language
Stars: ✭ 174 (-26.27%)
Mutual labels:  math, mathematics
Pybotics
The Python Toolbox for Robotics
Stars: ✭ 192 (-18.64%)
Mutual labels:  math, mathematics

>>> Jump to English Version <<<

朱利亚集合 Playground

此项目是一个能够生成“朱利亚集合(Julia Set) 分形图像的 Swift Playground 工程。朱利亚集合 是分形理论中的经典概念,它可以生成令人惊叹的分形图像。

朱利亚集合 的数学公式简单而优雅:

z(n+1) = z(n)^2 + c

...但它却能够产生出多样的、蕴含无线细节的美丽分形图像:

Xcode 8.3 Playground 截图

想要了解关于 朱利亚集合 的更多知识,请参阅 维基百科 Julia Set 中文条目

关于此项目

我曾与江苏卫视 最强大脑(第四季)节目组合作,共同打造了一个以分形数学为主题的挑战题目。节目现场使用了本项目的提供的分形图生成技术。该期节目于 2017 年 2 月 10 日播出,可以在爱奇艺网站观看:http://www.iqiyi.com/v_19rrapeyvc.html

江苏卫视「最强大脑」第四季,第 2017-2-10 期节目

此项目的核心技术也在我的个人 iOS 应用“分形的奥秘(Mysteries of Fractal) 中使用。强烈推荐给各位,可以在 App Store 中免费下载这个应用:App Store 链接

如何使用代码

下载 JuliaSet.playground 并使用最新版本的 Xcode 就可以编译运行。全部代码文件位于 JuliaSet.playground/Sources 目录下。

如果你有 iPad ,也可以在苹果的 Swift Playgrounds 应用中编译和运行本项目。

API 使用样例

你可以手动指定参数并观察它们如何影响分形图的生成:

let imageSize = CGSize(width: 600, height: 440)
var julia = JuliaSet()

julia.window = 4.0
julia.const = Complex(-0.5, 0.0)
julia.color = JuliaSetColor(
    hue: 0,
    brightness: 0.87,
    saturation: 0.9
)

let outputImage = JuliaSetRenderer.syncRender(julia, pixelSize: imageSize)

你也可以从 分形的奥秘 应用中导出某个特定的分形图,然后将它的代号放在 Playground 中绘制:

var code = "juliaset://?code=25477FFF7FFF7FEB5A4400FE"  // 从“分形的奥秘”中导出的一个分形
let outputImage = JuliaSetRenderer.syncRender(JuliaSet.decodeURL(code)!, pixelSize: imageSize)

渲染程序也支持异步渲染方法,它不会阻塞主线程。如果你准备在实际 iOS 项目中渲染分形图,这个方法就会很有用。

// 在后台渲染...
JuliaSetRenderer.asyncRender(julia, sizeInPixel: imageSize) { outputImage in
    // ...然后在主线程中获取结果
}

更多有趣的数学项目

联系方式


以下为英文版本 README

Julia Set Playground

This repo contains a Swift Playground that generates Julia set fractal images. Julia set is a classical concept in fractal mathematics, and it can be used to generate amazing fractal images.

The formula of Julia set is simple and elegant:

z(n+1) = z(n)^2 + c

...But it can generates varies beautiful fractal images with infinity details:

Xcode 8.3 Playground Screenshot

For more information about Julia set, See https://en.wikipedia.org/wiki/Julia_set.

This project is used in my iOS app Mysteries of Fractal (分形的奥秘). You can download it in the App Store for free. App Store Link

Installation

Just download JuliaSet.playground and open it by latest version of Xcode. All the code is in JuliaSet.playground/Sources folder.

If you have an iPad, you can also run this project using Apple's Swift Playgrounds app.

Sample Code

You can manually adjust the parameters and see how they affect the image:

let imageSize = CGSize(width: 600, height: 440)
var julia = JuliaSet()

julia.window = 4.0
julia.const = Complex(-0.5, 0.0)
julia.color = JuliaSetColor(
    hue: 0,
    brightness: 0.87,
    saturation: 0.9
)

let outputImage = JuliaSetRenderer.syncRender(julia, pixelSize: imageSize)

You can also export a specific fractal from the Mysteries of Fractal app, then draw it in playground:

var code = "juliaset://?code=25477FFF7FFF7FEB5A4400FE"  // exported by "Mysteries of Fractal" app
let outputImage = JuliaSetRenderer.syncRender(JuliaSet.decodeURL(code)!, pixelSize: imageSize)

The render also provides an asynchronous method to generate fractal image, which does not block the main thread. It's useful when you generate big image in a real iOS app.

// render in background...
JuliaSetRenderer.asyncRender(julia, sizeInPixel: imageSize) { outputImage in
    // ...then get result in main thread
}

More Mathematics Playground Projects

Contact

Feel free to contact me if you need more information ;)

Email: [email protected]

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].