I'm writing a small program that generates Bezier curves from given inputs, but I've come up against a brick wall.
Given two points (A, B), an x-intersect, and a perimeter P, find both points C along the x-intersect which create a triangle ABC such that AB + BC + AC = P. For example:
P = 12
A = (0, 0)
B = (4, 3)
C = (3, ?)
I understand that AB = 5 and therefore AC + BC = 7, but can't figure out how to extract C.y from:
AC + BC = sqrt((A.x-C.x)^2 + (A.y-C.y)^2) + sqrt((B.x-C.x)^2 + (B.y-C.y)^2)
Partial Progress :
Here is the line $AB$ , with the Potential Point $C$ on the Dashed line.
Point C must be on the Dashed line because the X-Coordinate is Constant @ 3.
When C is very high , $AC+CB$ is very large , tending to $\infty$.
When C moves downwards , $AC+CB$ is Decreasing , going through $7$ , then tending to minimum $5$ , when it is on the line $AB$.
When C more downwards , $AC+CB$ will Increase , going through $7$ , then tending to $\infty$.
Thus , there must be 2 Points where $AC+CB=7$
Let Point C have Co-ordinates $(3,Y)$.
The Equation is :
$\sqrt{(3-0)^2+(Y-0)^2}+\sqrt{(4-3)^2+(Y-3)^2}=7$
$\sqrt{9+Y^2}+\sqrt{1+(Y-3)^2}=7$
We can Square both sides , then move terms around , then Square both sides , to eliminate all Square roots. We will end up with the Polynomial Equation with maximum Degree 4. [[ thanks to user "TeM" , who showed that the terms $Y^4$ & $Y^3$ have Co-efficient $0$ , hence we get Quadratic Equation ! ]]
Wolfram gives these 2 Numerical Values :
$Y≈-0.77196$
$Y≈4.3720$
Wolfram gives these 2 Exact values :
$Y = 9/5 - (21 \sqrt{3/2})/10$
$Y = 9/5 + (21 \sqrt{3/2})/10$
This is via that Polynomial (( Quadratic , thanks to user "TeM" ! )) Equation.