/**
 * based on paper "Elliptification of Rectangular Imagery" by Chamberlain Fong, Joint Mathematics Meetings 2019, SIGMAA-ARTS
 * @param {Vector2} result
 * @param {number} x
 * @param {number} y
 */
export function uv_map_square_to_circle(result, x, y) {
    const alpha = Math.sqrt(1 + x * x * y * y);

    const u = x / alpha;
    const v = y / alpha;

    result.set(u, v);
}
