Approximate quadratic Bezier by a $1.0-\sqrt{x^2 + y^2}$ distance

57 Views Asked by At

Summary: I have a triangle with points at $A=(0, 100); B=(100, 0); C=(100, 100)$ each point also has an $F$ value, this value is linearly interpolated between every other point and used to get the distance using the formula $D=1.0-\sqrt{{F_x}^2 + {F_y}^2}$ of each pixel in this triangle. There are also limit variables $S=0.04; E=0.02$. If $D \geq S$ or $D \leq E$ the pixel color is red, otherwise the pixel is discarded.

IMAGE

On the image i've used $F(A)=(-1.0, 1.0); F(B)=(1.0, 1.0), F(C)=(1.0, -1.0)$ that generally would generate an arc with proper adjustment. The green line is a quadratic Bezier curve with the same points positions as the triangles, just for the showcase.

Question: How to calculate the $F$ values for each point to approximate the red line to a Bezier curve (green line) with the same points as the triangle without changing the distance function? If necessary, you can also add points to the triangle (to form a polygon) and/or move their positions.