# 在区域上解方程式

 In[1]:= Xline1 = InfiniteLine[{0, 0}, {1, 1}]; line2 = InfiniteLine[{{0, 1}, {1, 0}}];
 In[2]:= Xsol = NSolve[{x, y} \[Element] line1 \[And] {x, y} \[Element] line2, {x, y}]
 Out[2]=
 In[3]:= XGraphics[{{Lighter[Blue, 0.5], line1, line2}, {Red, Point[{x, y} /. sol]}}, Axes -> True]
 Out[3]=

 In[4]:= Xline = InfiniteLine[{0, 0}, {1, 1}]; circle = Circle[{0, 0}, 1];
 In[5]:= Xsol = Solve[{x, y} \[Element] line \[And] {x, y} \[Element] circle, {x, y}]
 Out[5]=
 In[6]:= XGraphics[{{Lighter[Blue, 0.5], line, circle}, {Red, Point[{x, y} /. sol]}}, Axes -> True]
 Out[6]=

 In[7]:= Xline = InfiniteLine[{0, 0}, {1, 1}]; circle = Circle[{0, 0}, 1];
 In[8]:= Xsol = Solve[p \[Element] line \[And] p \[Element] circle, p]
 Out[8]=
 In[9]:= XGraphics[{{Lighter[Blue, 0.5], line, circle}, {Red, Point[p /. sol]}}, Axes -> True]
 Out[9]=

 In[10]:= Xcircles = Table[Circle[{1/3 Cos[k 2 \[Pi]/5], 1/3 Sin[k 2 \[Pi]/5]}], {k, 0, 4}];
 In[11]:= Xsol = NSolve[ p \[Element] BooleanRegion[BooleanCountingFunction[{2}, 5], circles], p]
 Out[11]=
 In[12]:= XGraphics[{{Lighter[Blue, 0.5], circles}, {Red, PointSize[Medium], Point[p /. sol]}}]
 Out[12]=

 In[13]:= X{s1, s2, s3} = Table[Sphere[{1/3 Cos[k 2 \[Pi]/3], 1/3 Sin[k 2 \[Pi]/3], 0}], {k, 0, 2}];
 In[14]:= Xsol = Solve[ p \[Element] s1 \[And] p \[Element] s2 \[And] p \[Element] s3, p]
 Out[14]=
 In[15]:= XGraphics3D[{{Opacity[0.5], s1, s2, s3}, {Red, PointSize[Large], Point[p /. sol]}}]
 Out[15]=

## Mathematica

Questions? Comments? Contact a Wolfram expert »