Thursday, September 3, 2015

Canonical space in disc-to-square mapping

In this blog, I will discuss several ways to map the circular disc to a square and vice versa.  This is the canonical mapping space:














circular domain: {(u,v) | u² + v² ≤ 1}
square range: [-1,1] x [-1,1]

The points (u,v) are in circular disc coordinates
The points (x,y) are in square coordinates


===============================================
Some other relevant links:
1) Stackoverflow.com also discussed the mapping and asked for the inverse.
http://stackoverflow.com/questions/13211595/how-can-i-convert-coordinates-on-a-circle-to-coordinates-on-a-square
http://stackoverflow.com/questions/1621831/how-can-i-convert-coordinates-on-a-square-to-coordinates-on-a-circle

2) Greg Cope has a nice image of a square maze converted to a circular disc.
http://www.algosome.com/articles/maze-generation-depth-first.html

3) Peter Shirley mentioned Dave Cline's trick to simplify his concentric map code
http://psgraphics.blogspot.com/2011/01/improved-code-for-concentric-map.html

4) Stack exchange also has a discussion on this:
http://math.stackexchange.com/questions/440611/geometric-deformations/1662347#1662347

No comments:

Post a Comment