Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sagnac/complexcolor.jl
Simple interactive plotting of complex functions & arrays using domain coloring.
https://github.com/sagnac/complexcolor.jl
complex-analysis julia mathematics plotting
Last synced: 1 day ago
JSON representation
Simple interactive plotting of complex functions & arrays using domain coloring.
- Host: GitHub
- URL: https://github.com/sagnac/complexcolor.jl
- Owner: Sagnac
- Created: 2023-12-07T08:07:24.000Z (12 months ago)
- Default Branch: master
- Last Pushed: 2024-10-27T01:00:21.000Z (21 days ago)
- Last Synced: 2024-10-27T07:04:22.166Z (21 days ago)
- Topics: complex-analysis, julia, mathematics, plotting
- Language: Julia
- Homepage:
- Size: 922 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ComplexColor.jl
`complex_color(s, color = HSL)` converts an array of complex numbers into an image matrix of RGB values using a hue-lightness color mapping for the phase and modulus.
`complex_plot(x, y, s, color = HSL)` plots a complex number array `s` within the `x` and `y` limits using domain coloring in the HSL or perceptual OKLCH color spaces.
***Note***: The phase contour lines are kinda bugged at the moment at around `±π`; these contours are not displayed by default, but can be toggled on the plot.
## Installation
```julia
using Pkg
Pkg.add(url="https://github.com/Sagnac/ComplexColor.jl")
```Support for the Oklch color space requires the following fork:
```julia
Pkg.add(url="https://github.com/Sagnac/Colors.jl")
```## Plotting examples
```julia
using ComplexColor
# for a complex array
x = y = -2:0.01:2
z = complex.(x, y')
s = map(z -> 1/z, z)
fig = complex_plot(x, y, s; title = L"s = z^{-1}")
``````julia
# for a complex function over intervals
x = y = -2..2
f(z) = inv(z)
complex_plot(x, y, f)
```