pc_rectangular_conformal_map: Conformally map a disk-type point cloud to a rectangle

This code computes the rectangular conformal parameterizations (i.e. angle-preserving mappings onto a rectangle) of point clouds with disk topology using the fast method in [1].
Any comments and suggestions are welcome. 

If you use this code in your own work, please cite the following paper:
[1] T. W. Meng, G. P.-T. Choi and L. M. Lui, 
    "TEMPO: Feature-Endowed Teichmller Extremal Mappings of Point Clouds."
    SIAM Journal on Imaging Sciences, 9(4), pp. 1922-1962, 2016.

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

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



Usage:
[map,map_mu] = pc_rectangular_conformal_map(v,bdy_index,corner)


Input:
v: nv x 3 vertex coordinates of a disk-shaped point cloud
bdy_index: nb x 1 vertex indices of the boundary, with anti-clockwise orientation
(optional) corner: 4 x 1 vertex indices for the four corners of the rectangle, with anti-clockwise orientation
 4 - 3
 |   |
 1 - 2

Output:
map: nv x 2 vertex coordinates of the rectangular conformal parameterization
map_mu: nv x 1 Beltrami coefficient whose norm indicates the conformality distortion

Remark:
The output rectangular domain will always have width = 1, while the height depends on the choice of the corners and may not be 1.
(The Riemann mapping theorem guarantees that there exists a conformal map from any simple-connected open surface to the unit square, but if four vertices on the surface boundary are specified to be the four corners of the planar domain, the theorem is no longer applicable.)