Mathematica 9 is now available
Services & Resources / Wolfram Forums
-----
 /
MathGroup Archive
2004
*January
*February
*March
*April
*May
*June
*July
*August
*September
*October
*November
*December
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2004

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

Search the Archive

distance between pairs of parallel lines, select two from list of length four, symbolically

  • To: mathgroup at smc.vnet.net
  • Subject: [mg48106] distance between pairs of parallel lines, select two from list of length four, symbolically
  • From: Kai Gauer <gauerkk at uregina.ca>
  • Date: Thu, 13 May 2004 00:08:44 -0400 (EDT)
  • Sender: owner-wri-mathgroup at wolfram.com

Hi fellow newsgroup folks!

(** apologies for the lengthy post; thanks in **)
(**    advance for approaches at solutions    **)
(**         mathematica_version=3.0           **)

I can express a series of 4 linear_equations for plotting 
after assignment of coefficients as:

{

  2/161*(-2093 + 1/2*1*Sqrt[13*(-2 + 
Sqrt[533])]*(-648 - 25*Sqrt[533] + (+577 + 
24*Sqrt[533])*x - 23*(+22 + Sqrt[533])*y)) == 0, 

  2/161*(-2093 + 1/2*1*Sqrt[13*(-2 + 
Sqrt[533])]*(+648 + 25*Sqrt[533] - (+577 + 
24*Sqrt[533])*x + 23*(+22 + Sqrt[533])*y)) == 0, 

  2/161*(-2093 - 1/2*I*Sqrt[13*(+2 + 
Sqrt[533])]*(+648 - 25*Sqrt[533] + (-577 + 
24*Sqrt[533])*x - 23*(-22 + Sqrt[533])*y)) == 0, 

  2/161*(-2093 + 1/2*I*Sqrt[13*(+2 + 
Sqrt[533])]*(+648 - 25*Sqrt[533] + (-577 + 
24*Sqrt[533])*x - 23*(-22 + Sqrt[533])*y)) == 0

}. I can measure the distance between any two of these 
lines by selecting an (x1,y1) on one line, and computing 
the following:

	mydistance:=Abs[u*x1+v*y1+w]/Abs[Sqrt[u^2+v^2]] 

(** I would greatly prefer to later peel off the Abs[] from 
the denominator term, but in numeral form, I have to: first
calculate the denominator, and then rationalize it, and 
then cancel anything left from the new denominator with the
old numerator, having FullSimplify 'ied - I am also not 
even sure that I need to attach the Abs[], after reading 
some Linear Algebra texbooks **)

The question is: how to use a similar process to get a
rationalized denominator symbolic form of 
mydistance[a,b,c,f,g,h] (I have to re-write the u, v, w in 
terms of the variables above)?

The general form of linear_equations would start off looking like:

{

(4*h^2*(-(a*b) + h^2)*
(a*(-(b*c) + f^2) + b*g^2 + h*(-2*f*g + c*h)) + 
      Sqrt[2]*E^(I/2*Arg[(a*b*c - a*f^2 
- b*g^2 + 2*f*g*h - c*h^2)*(-a + b + Sqrt[(a - b)^2 + 
4*h^2])]*Sign[-(a*b*h) + h^3]^2)*
       Sqrt[(-(a*b*h) + h^3)^2*Sqrt[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))^2]]*(-(b*g) + 2*f*h 
+ g*Sqrt[(a - b)^2 + 4*h^2] + a^2*x + 2*h^2*x + b*h*y 
+ h*Sqrt[(a - b)^2 + 4*h^2]*y + a*(g - b*x 
+ Sqrt[(a - b)^2 + 4*h^2]*x + h*y))*Sqrt[Abs[-a + b 
+ Sqrt[(a - b)^2 + 4*h^2]]])/(4*(-(a*b*h) + h^3)^2) == 0, 


(4*h^2*(-(a*b) + h^2)*
(a*(-(b*c) + f^2) + b*g^2 + h*(-2*f*g + c*h)) - 
      Sqrt[2]*E^(I/2*Arg[(a*b*c - a*f^2 
- b*g^2 + 2*f*g*h - c*h^2)*(-a + b + Sqrt[(a - b)^2 + 
4*h^2])]*Sign[-(a*b*h) + h^3]^2)*
       Sqrt[(-(a*b*h) + h^3)^2*Sqrt[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))^2]]*(-(b*g) + 2*f*h 
+ g*Sqrt[(a - b)^2 + 4*h^2] + a^2*x + 2*h^2*x + b*h*y 
+ h*Sqrt[(a - b)^2 + 4*h^2]*y + a*(g - b*x 
+ Sqrt[(a - b)^2 + 4*h^2]*x + h*y))*Sqrt[Abs[-a + b 
+ Sqrt[(a - b)^2 + 4*h^2]]])/(4*(-(a*b*h) + h^3)^2) == 0, 


(4*h^2*(-(a*b) + h^2)*
(a*(-(b*c) + f^2) + b*g^2 + h*(-2*f*g + c*h)) + 
      Sqrt[2]*E^(I/2*Arg[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))*(+a - b + Sqrt[(a - b)^2 
+ 4*h^2])]*Sign[-(a*b*h) + h^3]^2)*
       Sqrt[(-(a*b*h) + h^3)^2*Sqrt[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))^2]]*(-(b*g) + 2*f*h 
- g*Sqrt[(a - b)^2 + 4*h^2] + a^2*x + 2*h^2*x + b*h*y 
- h*Sqrt[(a - b)^2 + 4*h^2]*y + a*(g - b*x 
- Sqrt[(a - b)^2 + 4*h^2]*x + h*y))*Sqrt[Abs[+a - b 
+ Sqrt[(a - b)^2 + 4*h^2]]])/(4*(-(a*b*h) + h^3)^2) == 0,

 
(4*h^2*(-(a*b) + h^2)*
(a*(-(b*c) + f^2) + b*g^2 + h*(-2*f*g + c*h)) + 
      Sqrt[2]*E^(I/2*Arg[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))*(+a - b + Sqrt[(a - b)^2 
+ 4*h^2])]*Sign[-(a*b*h) + h^3]^2)*
       Sqrt[(-(a*b*h) + h^3)^2*Sqrt[(a*(-(b*c) + f^2) 
+ b*g^2 + h*(-2*f*g + c*h))^2]]*(+(b*g) - 2*f*h 
+ g*Sqrt[(a - b)^2 + 4*h^2] - a^2*x - 2*h^2*x - b*h*y 
+ h*Sqrt[(a - b)^2 + 4*h^2]*y + a*(-g + b*x 
+ Sqrt[(a - b)^2 + 4*h^2]*x - h*y))*Sqrt[Abs[+a - b 
+ Sqrt[(a - b)^2 + 4*h^2]]])/(4*(-(a*b*h) + h^3)^2) == 0

}

But in this case, my only assignment of coefficients 
[a,b,c,f,g,h] occur at the mydistance function. Since 
mydistance can be any one (possibly more) of six operations
between the 2 lines in question, how do I choose the unique
positive real value of mydistance when the Abs is taken off
the denominator in the form similar to the above numerical 
operation and assign ExpandNumerator.

Notice that ExpandNumerator[3+Sqrt[5]/Sqrt[7]] reduces a 
rationalized denominator, but how to do this in a symbolic 
form? It may also help to notice that when the two real 
coefficient lines are returned, they appear to be parallel 
to one another. I also need to leave the formula in a form 
similar to this, and not looking like a TrigReduce[] type 
of equation.

I'd also like to keep whatever symmetries which you see 
here as stable as possible.

A normal approach is to sometimes subtract line1-line2 
where line1: Ax+By+C==0, line2: Ax+By+D==0 to come up with 
|D-C|, but I tried this approach, and in some cases, 
wouldn't remove the x and y terms (this is "harder" to work
with because of the rank 1 returmn value using linear 
algebra methods).

Kai G. Gauer


  • Prev by Date: Re: Eliminate duplicates using Union [] in a
  • Next by Date: got "Map" to work finally.
  • Previous by thread: forward link : Re: Mandelbrot Set & Mathematica
  • Next by thread: got "Map" to work finally.