<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
  <channel>
    <title>MaplePrimes - answers and comments on Question, Find a point in every region defined by a system of linear equations</title>
    <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined</link>
    <language>en-us</language>
    <copyright>2026 Maplesoft, A Division of Waterloo Maple Inc.</copyright>
    <generator>Maplesoft Document System</generator>
    <lastBuildDate>Thu, 11 Jun 2026 03:14:14 GMT</lastBuildDate>
    <pubDate>Thu, 11 Jun 2026 03:14:14 GMT</pubDate>
    <itunes:subtitle />
    <itunes:summary />
    <description>The latest answers and comments added to the Question, Find a point in every region defined by a system of linear equations</description>
    <image>
      <url>http://www.mapleprimes.com/images/mapleprimeswhite.jpg</url>
      <title>MaplePrimes - answers and comments on Question, Find a point in every region defined by a system of linear equations</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined</link>
    </image>
    <item>
      <title>All through the origin?</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74075</link>
      <itunes:summary>Two minor comments:

&lt;ul&gt;
&lt;li&gt;As written, your linear equations all describe lines passing through the origin, and so they define only unbounded regions. Instead of &lt;maple&gt;A[i]*x+B[i]*y = 0&lt;/maple&gt;, do you mean &lt;maple&gt;A[i]*x+B[i]*y = C[i]&lt;/maple&gt;?
&lt;/ li&gt;&lt;li&gt;Disregarding the degenerate cases, where one or more lines are parallel or identical, there are not &lt;code&gt;(8-1)! = 5040&lt;/code&gt; intersection points between pairs of lines, but only &lt;code&gt;binomial(8,2) = 28&lt;/code&gt;.
&lt;/ li&gt;
&lt;/ul&gt;</itunes:summary>
      <description>Two minor comments:

&lt;ul&gt;
&lt;li&gt;As written, your linear equations all describe lines passing through the origin, and so they define only unbounded regions. Instead of &lt;maple&gt;A[i]*x+B[i]*y = 0&lt;/maple&gt;, do you mean &lt;maple&gt;A[i]*x+B[i]*y = C[i]&lt;/maple&gt;?
&lt;/ li&gt;&lt;li&gt;Disregarding the degenerate cases, where one or more lines are parallel or identical, there are not &lt;code&gt;(8-1)! = 5040&lt;/code&gt; intersection points between pairs of lines, but only &lt;code&gt;binomial(8,2) = 28&lt;/code&gt;.
&lt;/ li&gt;
&lt;/ul&gt;</description>
      <guid>74075</guid>
      <pubDate>Tue, 15 Jan 2008 19:05:14 Z</pubDate>
      <itunes:author>John Fredsted</itunes:author>
      <author>John Fredsted</author>
    </item>
    <item>
      <title>Presently stuck</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74073</link>
      <itunes:summary>At present I have coded the following:

&lt;ul&gt;
&lt;li&gt;Generating some coefficients (the factor &lt;code&gt;5&lt;/code&gt; is present to get some interesting plot):
&lt;pre&gt;
n := 8:
gen := rand(10000) - 5000:
a := [seq(gen(),i=1..n)];
b := [seq(gen(),i=1..n)];
c := [5*seq(gen(),i=1..n)];
&lt;/pre&gt;
&lt;/ li&gt;&lt;li&gt;Generating the equations for the lines:
&lt;pre&gt;
eqs := [seq(a[i]*x + b[i]*y = c[i],i = 1..n)];
&lt;/pre&gt;
&lt;/ li&gt;&lt;li&gt;Plotting the lines:
&lt;pre&gt;
plot(map(solve,eqs,y),x = -10..10);
&lt;/pre&gt;
giving, for instance,
&lt;img src='http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/1808_Regions.gif&amp;width=300&amp;height=300'/&gt;
&lt;/ li&gt;
&lt;/ul&gt;

But I have no clear idea yet as to how to obtain the coordinates of some points inside those regions. Maybe the fact (unless I am fundamentally mistaken) that all bounded regions are convex polygons is helpful: most probably there exist some powerful procedure in such a case. Hopefully, some hardcore mathematician, which I am not, can help us here.</itunes:summary>
      <description>At present I have coded the following:

&lt;ul&gt;
&lt;li&gt;Generating some coefficients (the factor &lt;code&gt;5&lt;/code&gt; is present to get some interesting plot):
&lt;pre&gt;
n := 8:
gen := rand(10000) - 5000:
a := [seq(gen(),i=1..n)];
b := [seq(gen(),i=1..n)];
c := [5*seq(gen(),i=1..n)];
&lt;/pre&gt;
&lt;/ li&gt;&lt;li&gt;Generating the equations for the lines:
&lt;pre&gt;
eqs := [seq(a[i]*x + b[i]*y = c[i],i = 1..n)];
&lt;/pre&gt;
&lt;/ li&gt;&lt;li&gt;Plotting the lines:
&lt;pre&gt;
plot(map(solve,eqs,y),x = -10..10);
&lt;/pre&gt;
giving, for instance,
&lt;img src='http://www.mapleprimes.com/scripts/image.php?image=http://www.mapleprimes.com/files/1808_Regions.gif&amp;width=300&amp;height=300'/&gt;
&lt;/ li&gt;
&lt;/ul&gt;

But I have no clear idea yet as to how to obtain the coordinates of some points inside those regions. Maybe the fact (unless I am fundamentally mistaken) that all bounded regions are convex polygons is helpful: most probably there exist some powerful procedure in such a case. Hopefully, some hardcore mathematician, which I am not, can help us here.</description>
      <guid>74073</guid>
      <pubDate>Tue, 15 Jan 2008 20:36:12 Z</pubDate>
      <itunes:author>John Fredsted</itunes:author>
      <author>John Fredsted</author>
    </item>
    <item>
      <title>That looks absolutely great.</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74072</link>
      <itunes:summary>That looks absolutely great. Thank you so much

Please ignore my other posting - I had not expected further reply</itunes:summary>
      <description>That looks absolutely great. Thank you so much

Please ignore my other posting - I had not expected further reply</description>
      <guid>74072</guid>
      <pubDate>Tue, 15 Jan 2008 21:35:36 Z</pubDate>
      <itunes:author>brian abraham</itunes:author>
      <author>brian abraham</author>
    </item>
    <item>
      <title>Arrangement of Lines</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74070</link>
      <itunes:summary>For what it is worth, the construct you are looking at is called an &lt;a href="http://www2.toki.or.id/book/AlgDesignManual/BOOK/BOOK5/NODE198.HTM"&gt;arrangement of lines in the plane&lt;/a&gt; by folks in &lt;a href="http://en.wikipedia.org/wiki/Computational_Geometry"&gt;computational geometry&lt;/a&gt;.  It seems like some sort of topological sweep should be able to get you what you are looking for.  

Sadly, it's been a while since the computational geometry class I had back in grad school or I could help with more than just names of things.</itunes:summary>
      <description>For what it is worth, the construct you are looking at is called an &lt;a href="http://www2.toki.or.id/book/AlgDesignManual/BOOK/BOOK5/NODE198.HTM"&gt;arrangement of lines in the plane&lt;/a&gt; by folks in &lt;a href="http://en.wikipedia.org/wiki/Computational_Geometry"&gt;computational geometry&lt;/a&gt;.  It seems like some sort of topological sweep should be able to get you what you are looking for.  

Sadly, it's been a while since the computational geometry class I had back in grad school or I could help with more than just names of things.</description>
      <guid>74070</guid>
      <pubDate>Tue, 15 Jan 2008 21:42:20 Z</pubDate>
      <itunes:author>jpmay</itunes:author>
      <author>jpmay</author>
    </item>
    <item>
      <title>Linear Programming</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74068</link>
      <itunes:summary>Suppose L is a list of expressions A[i]*x + B[i]*y - C[i], and S is a subset of {$1..n}.  Then applyop(`*`,S,L,-1) multiplies the expressions numbered by members of S by -1.  Make each of the results r into an inequality r &amp;lt; 0, and then you can call LinearUnivariateSystem on the result.  Thus:

&lt;pre&gt;
&gt; L := [seq](A[i]*x + B[i]*y - C[i], i=1..8);
  P:= map( t -&gt;  
     SolveTools[Inequality][LinearUnivariateSystem](
       map(`&amp;lt;`, applyop(`*`,t,L,-1), 0), x),
     combinat[powerset]({$1..8}));
&lt;/pre&gt;
     
But to actually get a point in each region, I think linear programming (LPSolve in the Optimization package) might be better.  If a region given by a set of inequalities A[i]*x + B[i]*y - C[i] &amp;lt; 0 is nonempty and bounded, you can find a point in it by maximizing t such that A[i]*x + B[i]*y - C[i] + t &amp;lt;= 0.  If the region is unbounded, add a constraint t &amp;lt;= M for some large M (say 10^6; this might have to be adjusted).  So I might try something like this:

&lt;pre&gt;
&gt; getpt:= proc(T)
    local R, t;
    R:= convert(map(s -&gt; (s + t &amp;lt;= 0), T),set) 
      union {t &amp;lt;= 10^6};
    R:= Optimization[LPSolve](t, R, maximize = true);
    if R[1] &amp;lt;= 0 then NULL 
    else subs(R[2],[x,y])
    fi;
  end;
  
  map(t -&gt; getpt(applyop(`*`,t,L,-1)), 
        combinat[powerset]({$1..8}));
&lt;/pre&gt;    

</itunes:summary>
      <description>Suppose L is a list of expressions A[i]*x + B[i]*y - C[i], and S is a subset of {$1..n}.  Then applyop(`*`,S,L,-1) multiplies the expressions numbered by members of S by -1.  Make each of the results r into an inequality r &amp;lt; 0, and then you can call LinearUnivariateSystem on the result.  Thus:

&lt;pre&gt;
&gt; L := [seq](A[i]*x + B[i]*y - C[i], i=1..8);
  P:= map( t -&gt;  
     SolveTools[Inequality][LinearUnivariateSystem](
       map(`&amp;lt;`, applyop(`*`,t,L,-1), 0), x),
     combinat[powerset]({$1..8}));
&lt;/pre&gt;
     
But to actually get a point in each region, I think linear programming (LPSolve in the Optimization package) might be better.  If a region given by a set of inequalities A[i]*x + B[i]*y - C[i] &amp;lt; 0 is nonempty and bounded, you can find a point in it by maximizing t such that A[i]*x + B[i]*y - C[i] + t &amp;lt;= 0.  If the region is unbounded, add a constraint t &amp;lt;= M for some large M (say 10^6; this might have to be adjusted).  So I might try something like this:

&lt;pre&gt;
&gt; getpt:= proc(T)
    local R, t;
    R:= convert(map(s -&gt; (s + t &amp;lt;= 0), T),set) 
      union {t &amp;lt;= 10^6};
    R:= Optimization[LPSolve](t, R, maximize = true);
    if R[1] &amp;lt;= 0 then NULL 
    else subs(R[2],[x,y])
    fi;
  end;
  
  map(t -&gt; getpt(applyop(`*`,t,L,-1)), 
        combinat[powerset]({$1..8}));
&lt;/pre&gt;    

</description>
      <guid>74068</guid>
      <pubDate>Tue, 15 Jan 2008 21:48:24 Z</pubDate>
      <itunes:author>Robert Israel</itunes:author>
      <author>Robert Israel</author>
    </item>
    <item>
      <title>If I might just ask for a</title>
      <link>http://www.mapleprimes.com/questions/40236-Find-A-Point-In-Every-Region-Defined?ref=Feed:MaplePrimes:Find a point in every region defined by a system of linear equations:Comments#answer74066</link>
      <itunes:summary>If I might just ask for a little more help.  I am struggling to understand what is going on in the first section of your code Robert.

I have written it out in a little fuller form 

L := [seq](A[i]*x + B[i]*y - C[i], i=1..8):
&gt; CPS:=combinat[powerset]({$1..8}):
&gt; P:= map( t -&gt;       (     map(`&lt;`,        applyop(`*`,t,L,-1)       , 0)   ) ,    CPS);

But that last line is eluding me.  In particular the t in the applyop

Thank for all the help so far.  </itunes:summary>
      <description>If I might just ask for a little more help.  I am struggling to understand what is going on in the first section of your code Robert.

I have written it out in a little fuller form 

L := [seq](A[i]*x + B[i]*y - C[i], i=1..8):
&gt; CPS:=combinat[powerset]({$1..8}):
&gt; P:= map( t -&gt;       (     map(`&lt;`,        applyop(`*`,t,L,-1)       , 0)   ) ,    CPS);

But that last line is eluding me.  In particular the t in the applyop

Thank for all the help so far.  </description>
      <guid>74066</guid>
      <pubDate>Tue, 15 Jan 2008 23:13:24 Z</pubDate>
      <itunes:author>brian abraham</itunes:author>
      <author>brian abraham</author>
    </item>
  </channel>
</rss>