Online Python Domain Coloring
Overview
Domain coloring is used to visual complex functions. This Python code is converted from the C Domain Coloring tool, and then made hopefully 'safe' to run online.
Instructions
- Fill out the captcha
- Enter a function
- Available variables
- c -- Complex input
- x -- Current horizontal position
- y -- Current vertical position
- j -- Always equal to i
- Quirks
- Python syntax required
- Only 1 line allowed
- Available variables
- Finally hit Graph, wait a minute and you should have a png file with the graph. The ranges are from -4 - 4i to 4 + 4i
Input
Source Code
domainColoring.py -- Full source code used to generate the domain coloring picutres
Conclusion
I really did this to try to learn Python. There are a handful of bugs that I plan to never fix, unless there is somehow a demand, which will never happen. But here they are for posterity's sake:
- Only 1 line of text: Mainly laziness and not wanting people putting in insane functions that would run forever
- Loss of color: Python rounds differently than C, causing some loss of color. I actually did try to debug this, but I didn't immediately see the issue. I will readdress this when Python 2.6 is standard on my host, since it has new math functions I need that 2.5 does not have
Comments(2)
2009-05-16 01:59:17
(2009-05-16 10:52:36) Gavin Black said:
I originally was going to do it in JS but there are a ton of problems: > No good complex number functions: csin, mod, etc. > Limited math functions available > Scripts will halt after a while, I tried doing a decent resolution mandelbrot set once and it would bug the user every few lines that the script was taking too long. > No good way to draw continous pictures, canvas sucks and doing a whole bunch of path expressions in something like SVG is also painful. Python 2.5 was bad enough about having enough math functions to barely get something working. If there is too much usage I\'ll just disable it, or make it a very tiny picture.(2009-05-16 06:37:32) Chris Wellons said:
That\'s pretty generous handing out free server CPU like that! Perhaps a Javascript version would be useful (but very slow). Add your comment:
Hardware
Software
- TAIM (Alpha Version): GHCI integration with vim
- CheaTorrent -- An evil BitTorrent client
- Self Modifying 2D Turing Automata
- Competing Conway Life Automata
- X11 Timelapse Desktop Video
- Colored Wolfram Automata With Sound Input
- Pseudo Video Feedback in Processing
- Haskell Cipher Saber
- Illegal FIlenames -- Windows and *nix
- Simple Perl SDL Music Keyboard (Updated)
- Image to Spectrogram
- Pastebin Hell
- OMGWTFRNG (OWR)
- OTP Enhancement : Failure Report
- Java Network File Transfer Tool
- AES Encrypted Filesystem Speeds
- Dual Message Encryption
- PHP Website
- Mp3 Splitting Script
- Random Obfuscation Tool
- Filesystem Speed Comparisons
- Java Based Web Server GUI