h = 1.;
p1 = {Sqrt[8], -1, h};
p2 = {0, 3.3, h};
p3 = {-Sqrt[8], -1, h};
n1 = Normalize[p1]; n2 = Normalize[p2]; n3 = Normalize[p3];
mg = 3;
\[Mu]1 = \[Mu]2 = \[Mu]3 = 1;
\[Omega][x_] = ArcTan[x];
\[Omega]1 = \[Omega][\[Mu]1];
\[Omega]2 = \[Omega][\[Mu]2];
\[Omega]3 = \[Omega][\[Mu]3];
{r, \[Theta]0, \[Phi]0} ={2.57776, 0.16065, 1.5708}
angle ={{0.16065, 1.5708}, {0.259131, 1.58816}, {0.254619, 1.605}, {0.247253,
1.6208}, {0.237255, 1.63508}, {0.224929, 1.6474}, {0.21065,
1.6574}, {0.194852, 1.66477}, {0.178015, 1.66928}, {0.16065,
1.6708}, {0.143285, 1.66928}, {0.126448, 1.66477}, {0.11065,
1.6574}, {0.0963714, 1.6474}, {0.0840457, 1.63508}, {0.0740476,
1.6208}, {0.0666809, 1.605}, {0.0621693, 1.58816}, {0.0606501,
1.5708}, {0.0621693, 1.55343}, {0.0666809, 1.53659}, {0.0740476,
1.5208}, {0.0840457, 1.50652}, {0.0963714, 1.49419}, {0.11065,
1.48419}, {0.126448, 1.47683}, {0.143285, 1.47232}, {0.16065,
1.4708}, {0.178015, 1.47232}, {0.194852, 1.47683}, {0.21065,
1.48419}, {0.224929, 1.49419}, {0.237255, 1.50652}, {0.247253,
1.5208}, {0.254619, 1.53659}, {0.259131, 1.55343}, {0.26065,
1.5708}}
For[i = 1, i <= nn, i++,
\[Theta]1 = angle[[i, 1]];
\[Phi]1 = angle[[i, 2]];
xa = {a, b, c};
a = r1 Sin[\[Theta]1] Cos[\[Phi]1];
b = r1 Sin[\[Theta]1] Sin[\[Phi]1];
c = r1 Cos[\[Theta]1];
f = Solve[(1 + \[Mu]1^2) (n1.(xa - p1)) (n1 .(xa - p1)) - ((xa -
p1). (xa - p1)) (n1. n1) == 0];
Print[f, {\[Theta]1}, {\[Phi]1}]
]
如上方程,解出的答案r与对应的φθ差了一位
例如{r1->2.55592}}{0.16065}{1.5708}
和{r1->2.57776}}{0.259131}{1.58816}
复制之后代回原方程第二行的r对应的是第一行的φθ
r3 = 2.55592
\[Theta]3 = 0.16065011224930292`
\[Phi]3 = 1.5707963267948966`
xa3 = {a3, b3, c3};
a3 = r3 Sin[\[Theta]3] Cos[\[Phi]3];
b3 = r3 Sin[\[Theta]3] Sin[\[Phi]3];
c3 = r3 Cos[\[Theta]3];
(1 + \[Mu]1^2) (n1.(xa3 - p1)) (n1 .(xa3 - p1)) - ((xa3 - p1). (xa3 -
p1)) (n1. n1) == 0