tlycken/Contour.jl — pull request #16 by darwindarak (2014-11-07 18:58:58+00:00)
Title: WIP: Support for curvilinear coordinates

It almost works!

```julia
θ = linspace(0,2π,10)
R = linspace(1,3, 10)
ζ = Complex128[r*exp(im*ϕ) for ϕ in θ, r in R]
x, y, z = real(ζ), imag(ζ), abs(ζ)
```

so `z` has the form

```
10x10 Array{Float64,2}:
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
1.0 1.22222 1.44444 1.66667 1.88889 2.11111 2.33333 2.55556 2.77778 3.0
```

which would look like straight lines if plotted in rectangular coordinates. But if the matrices `x` and `y` that contain the coordinate points are passed in, we get

![circles](https://cloud.githubusercontent.com/assets/7328215/4958451/f9a2fb3a-66ae-11e4-8a16-3ca74b5dd92a.png)

There are still a few kinks to work out though. For example:

```julia
θ = linspace(0,2π,100);
R = linspace(1,2, 50);
ζ = Complex128[r*exp(im*ϕ) for ϕ in θ, r in R];
x, y = real(ζ), imag(ζ);
z = imag(ζ .+ conj(1./ζ));
```

results in

![cylinder](https://cloud.githubusercontent.com/assets/7328215/4958452/faafdcb4-66ae-11e4-9744-335f96b8f40e.png)