I am trying to come up with a function that allows me to "transform a triangle into a circle".
For example, given a circumference with radius $1$ and center $(0,0)$ , imagine a triangle inscribed in the circumference such that these are its vertexes and one of the $3$ middle points of the $3$ sides:
$$P_{1}(x,y) = (0,1)$$ $$P_{2}(x,y) = (\frac{\sqrt3}{2},-\frac{1}{2})$$ $$P_{3}(x,y) = (-\frac{\sqrt3}{2},-\frac{1}{2})$$ $$P_{4}(x,y) = (0,-\frac{1}{2})$$
After applying the transform, all of these points should end up in the circumference with radius $1$.
What I think I must do is:
- Transform points to polar coordinates $r,\sigma$ $$P_{1}(r,\sigma) = (1,90º)$$ $$P_{2}(r,\sigma) = (1,210º)$$ $$P_{3}(r,\sigma) = (1,330º)$$ $$P_{4}(r,\sigma) = (0.5,270º)$$
- Multiply the r by a function $F(\sigma)$, such that:
$F(90º) = 1$ such that $P_{1}(r,\sigma)·1 = (1,90º)$
$F(210º) = 1$ such that $P_{2}(r,\sigma)·1 = (1,210º)$
$F(330º) = 1$ such that $P_{3}(r,\sigma)·1 = (1,330º)$
$F(270º) = 2$ such that $P_{4}(r,\sigma)·2 = (1,270º)$
- Transform the points back to cartesian coordinates $x,y$
So I thought, given a trajectory starting at the origin, and with a direction defined by the angle $\sigma$, I could compute the distance $D(\sigma)$ from the origin to where such trajectory intersects the triangle (positive direction only), and invert it ($F(\sigma) = D(\sigma)^{-1}$).
Is my assumption correct? I can't figure out how to find such a function $D(\sigma)$ that expresses the distance from the origin to the triangle for a given angle $\sigma$. Will it be a sinusoidal oscillating from $1$ to $0.5$ with a period of $120º$ ?