DEM_main: Compute the density-equalizing map of a simply-connected open surface based on a prescribed population (with free boundary condition)
DEM_rect: Compute the density-equalizing map of a simply-connected open surface based on a prescribed population (with square/rectangular boundary condition)
DEM_disk: Compute the density-equalizing map of a simply-connected open surface based on a prescribed population (with disk/elliptic boundary condition)

These codes compute the density-equalizing maps of a simply-connected open surface with various boundary conditions based on a prescribed population using the fast methods in [1].
Any comments and suggestions are welcome. 

If you use this code in your own work, please cite the following paper:
[1] G. P. T. Choi and C. H. Rycroft, 
    "Density-equalizing maps for simply connected open surfaces."
    SIAM Journal on Imaging Sciences, 11(2), pp. 1134-1178, 2018.

Copyright (c) 2017-2018, Gary Pui-Tung Choi
https://scholar.harvard.edu/choi

===============================================================



Usage:

map = DEM_main(v,f,population,initial_map,epsilon,step_ratio)

Input:
v: nv x 2 or nv x 3 vertex coordinates
f: nf x 3 triangulation
population: nf x 1 positive array
initial_map: nv x 2 coordinates of the initial flattening map
(Optional) epsilon: stopping parameter (default = 0.001)
(Optional) step_ratio: rescale the step size (default = 1)

Output:
map: nv x 2 density-equalizing map 

===============================================================



Usage:
map = DEM_rect(v,f,population,initial_map,corner,epsilon,step_ratio)

Input:
v: nv x 2 or nv x 3 vertex coordinates
f: nf x 3 triangulation
population: nf x 1 positive array
initial_map: nv x 2 coordinates of the initial flattening map
corner: 1 x 4 vertex indices of the corner
(Optional) epsilon: stopping parameter (default = 0.001)
(Optional) step_ratio: rescale the step size (default = 1)

Output:
map: nv x 2 density-equalizing map 

===============================================================



Usage:
map = DEM_disk(v,f,population,initial_map,epsilon,step_ratio)

Input:
v: nv x 2 or nv x 3 vertex coordinates
f: nf x 3 triangulation
population: nf x 1 positive array
initial_map: nv x 2 coordinates of the initial flattening map
(Optional) epsilon: stopping parameter (default = 0.001)
(Optional) step_ratio: rescale the step size (default = 1)

Output:
map: nv x 2 density-equalizing map 
