# Solve Equations over Regions

Solve equations and inequalities with region constraints. Region constraints are expressed using and can be used together with other constraints. Symbolic equation solvers as well as global numeric equation solvers support these new constraints.

Find the intersection of two infinite lines.

 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]=

Find the intersections between a line and a circle exactly.

 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]=

Use symbolic vector variables to solve the same problem.

 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]=

Find all pairwise intersections of the given circles.

 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]=

Find the points where three spheres intersect.

 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 »