Still working this problem of intersection of line and circle. Trying to simplify. Here is initial calculation:
Code 1:
ClearAll["Global`*"]
ClearAll[x, w, b, m, R, xo, phiw, y, J, solns1]
{x, w, b, m, R, xo, phiw} \[Element] Reals
Solve[{x, w} \[Element]
InfiniteLine[{{0, b}, {-b/m, 0}}] && {x, w} \[Element]
Circle[{xo, 0}, R], {x, w}]
FullSimplify[%,
0 < phiw < Pi/2 && R >= 0 && m >= 0 && b >= 0 && xo >= 0]
% /. m -> Tan[phiw]
solns1 =
FullSimplify[%, Reals,
Assumptions -> 0 < phiw < Pi/2 && b >= 0 && J >= 0 && xo >= 0 ]
x /. solns1[[2]]
This gives two solution for x and w. The algebraic is easier to follow, but the trig gives a simpler solution as last step. After some manipulation, I can clean these up. For example, for one solution, if I do by hand, I get:
Code 2:
m = Tan[phiw]
w = (b + m (xo + Sqrt[(1 + m^2) R^2 - (b + m xo)^2]))/(
1 + m^2) = (b + m xo + m Sqrt[(1 + m^2) R^2 - (b + m xo)^2])/(
1 + m^2) = (b + m xo)/(Sqrt[(1 + m^2)] Sqrt[(1 + m^2)]) + (
m Sqrt[(1 + m^2) R^2 - (b + m xo)^2])/(
Sqrt[(1 + m^2)] Sqrt[(1 + m^2)])
= (b + m xo)/(Sqrt[(1 + m^2)] Sqrt[(1 + m^2)]) + (
m Sqrt[(1 + m^2) R^2 - (b + m xo)^2])/(
Sqrt[(1 + m^2)] Sqrt[(1 + m^2)]) = (b + m xo)/(
Sqrt[(1 + m^2)] Sqrt[(1 + m^2)]) + (
m Sqrt[R^2 - (b + m xo)^2/(1 + m^2)])/Sqrt[(1 + m^2)] =
Ro/Sqrt[(1 + m^2)] + (m Sqrt[R^2 - Ro^2])/Sqrt[(1 + m^2)]
w = Ro Cos[phiw] + Sqrt[R^2 - Ro^2] Sin[phiw]
(b + m xo)^2/(1 + m^2) = Ro^2
x = (-b m + xo + Sqrt[(1 + m^2) R^2 - (b + m xo)^2])/(
1 + m^2) = (-b m + xo )/(1 + m^2) + Sqrt[
R^2 - (b + m xo)^2/(1 + m^2)]/Sqrt[(1 + m^2)] = (-b m + xo )/(
1 + m^2) + Sqrt[R^2 - Ro^2]/Sqrt[(1 + m^2)]
x = -b Cos[phiw] Sin[phiw] + xo Cos[phiw]^2 +
Sqrt[R^2 - Ro^2] Sin[phiw]
Note m is the slope of the line. And you get a little simpler after using Tan[phi]. Ro is the specific circle radius that gives one solution, or the tangent line.
First question, how do I do these manipulations in Mathematica. Doing by defeats the purpose.
Second, when I try and equate the initial solution set with my manipulated set, they are clearly equal. But I can't get == or === or in combination with Expand or Reduce, can't get a True. This was the code for this comparison next. What is the secret to showing these are equal?
Workbook is attached.
Code 3:
ClearAll["Global`*"]
ClearAll[x, w, b, m, R, xo, phiw, y, J, solns1, x1, x2, s1, s2]
{x, w, b, m, R, xo, phiw} \[Element] Reals
m = Tan[phiw]
x1 = (-b m + xo + Sqrt[(1 + m^2) R^2 - (b + m xo)^2])/(1 + m^2)
x2 = -b Cos[phiw] Sin[phiw] + xo Cos[phiw]^2 +
Sqrt[R^2 - (b + m xo)^2/(1 + m^2)] Sin[phiw]
x1 == x2
s1 = FullSimplify[x1, Reals,
Assumptions -> 0 < phiw < Pi/2 && b >= 0 && J >= 0 && xo >= 0 ]
s2 = FullSimplify[x2, Reals,
Assumptions -> 0 < phiw < Pi/2 && b >= 0 && J >= 0 && xo >= 0 ]
s1 == s2
Attachments: