MathGroup Archive 2006

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Resolve/Reduce is taking forever

  • To: mathgroup at smc.vnet.net
  • Subject: [mg67237] Re: Resolve/Reduce is taking forever
  • From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
  • Date: Wed, 14 Jun 2006 06:28:41 -0400 (EDT)
  • Organization: Uni Leipzig
  • References: <e6lhfd$nd3$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

a) a line and a polynom of third order *must* have 
a crossing
   some where in the plane, so a infinite line 
will never stay
   left of the curve, except a3 is zero
b) you can search for the solutions a3×t^3 + 
a2×t^2 + a1×t + a0==b1×t + b0
   and look if there is a real solution and if the 
real solution
   is in the range 0 <= t <= 1
c) when you found no valid real solution you can 
just calculate
   Integrate[b1×t + b0-(a3×t^3 + a2×t^2 + a1×t + 
a0),{t,0,1}]
   when the value is positive than the line is 
above (left) the polynom
   and otherwiese it its below (right) the polynom

Regards
  Jens

"Bonny Banerjee" <banerjee at cse.ohio-state.edu> 
schrieb im Newsbeitrag 
news:e6lhfd$nd3$1 at smc.vnet.net...
|I am trying to write a simple function that 
determines the conditions for a
| curve to be on the left of a straight line. A 
curve is to the left of a
| straight line if each point on the curve is to 
the left of the straight
| line. The curve is specified using parametric 
equations:
|
| x -> a3×t^3 + a2×t^2 + a1×t + a0
| y -> b1×t + b0
|
| where t is the parameter, 0<=t<=1, and {a0, a1, 
a2, a3, b0, b1} are real
| coefficients. The straight line is specified 
using two points {x1,y1} and
| {x2,y2}.
|
| Here is the function:
|
| isLeftofLine[{x1_, y1_}, {x2_, y2_}, {a0_, a1_, 
a2_, a3_, b0_, b1_}] =
| Resolve[
|      ForAll[t, 0 <= t <= 1 => fxy[{x1, y1}, {x2, 
y2}, {a3×t^3 + a2×t^2 +
|     a1×t + a0, b1×t + b0}] <= 0],
| {a0, a1, a2, a3, b0, b1}, Reals]
|
| where
|
| fxy[{x1_, y1_}, {x2_, y2_}, {x_, y_}] =
| (x - x1)×(y2 - y1) - (y - y1)×(x2 - x1)
|
| I tried Resolve and Reduce but both are taking 
forever. I waited for more
| than 4 hours but could not get any result from 
any of them. Considering this
| is a simple logical expression with only one 
universal quantifier, I am
| surprised at what might be taking so long.
|
| Any insights would be very helpful. Also, any 
alternative method for solving
| the same problem, such as using any other 
function in place of
| Reduce/Resolve or using a different 
representation for the curve or straight
| line, would be nice to know. I preferred using 
parametric equations for
| representing the curve as the curve is finite.
|
| Thanks,
| Bonny.
|
|
| 



  • Prev by Date: Getting the (correct) roots of a polynomial
  • Next by Date: Re: .NET/Link and two-dimensional strings
  • Previous by thread: Re: Re: Re: Resolve/Reduce is taking forever
  • Next by thread: RE: Resolve/Reduce is taking forever