Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/czlee/cme257hw4czlee
CME 257 Homework 4. Tool for visualizing Julia sets.
https://github.com/czlee/cme257hw4czlee
Last synced: 1 day ago
JSON representation
CME 257 Homework 4. Tool for visualizing Julia sets.
- Host: GitHub
- URL: https://github.com/czlee/cme257hw4czlee
- Owner: czlee
- License: other
- Created: 2015-10-15T20:02:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2015-10-15T22:05:27.000Z (over 9 years ago)
- Last Synced: 2025-01-05T20:43:20.316Z (15 days ago)
- Language: Julia
- Size: 109 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# cme257hw4czlee: Julia sets
This package contains one function:
juliaset{T<:Real}(R::Function, x::AbstractVector{T}, y::AbstractVector{T},
n_iter=50, escape_tol=1e10)`R(z)` is expected to be a rational function of the form `P(z)/Q(z)`, where `P`
and `Q` are polynomials in `z` without common divisors.The function returns an `length(x)`-by-`length(y)` matrix whose `[i,j]`-th
element denotes the number of iterations it took the norm of `z[i,j] = x[i] +
im*y[j]` to exceed `escape_tol`, where in each iteration `z[i,j]` is replaced by
`R(z[i,j])`. If it takes longer than `n_iter` iterations, the relevant element
of the returned matrix will be `n_iter+1`.## Example
``` julia
using cme257hw4czlee
using PyPlot
R = z -> (5z^4 + 3z^2 + z) / (z^2 - 9z + 3)
x = -5:0.025:5
y = -5:0.025:5
J = juliaset(R, x, y);
matshow(J)
```