1

$c = \sqrt{a^2 + x^2} + \sqrt{(b - x)^2 + (a - x)^2}$

Reformulated as a quartic equation:

$x^4 + (-a - b)x^3 + (a^2 + ab + 2b^2 - c^2)x^2 + (-ab^2 - b^3)x + (-a^2c^2 + b^4 + c^4) = 0$

Is there an expression for $x$ (always positive) which is solvable if $a$, $b$, and $c$ are known?


Background: In Grasshopper, I have a rectangle of known dimensions and two joined lines $DE$ and $EF$ as below, the sum of the lengths of which is known. I'd like to find the length of $AE$ or $CF$, or one of the angles $ADE$ or $EDC$ where $AE = CF$ (any of these will yield the rest).

Rectangle ABCD circumscribing joined lines DE and EF where E lies along AB, F lies along BC, and AE = CF

As far as I know, there is no Grasshopper component (outside of custom VB, Python or C# components which are beyond me at the moment) which will return an array of values for two variables where a given equation holds true, so I think I have to find one of the above (length of $AE$ or $CF$, or one of the angles $ADE$ or $EDC$) using a single expression. I also want to avoid using Grasshopper to test a range of possible values, which seems processing intensive.

Edit to add: I arrived at the equation at the top this way:

$DE = \sqrt{a^2 + x^2}$

$EF = \sqrt{(b-x)^2 + (a-x)^2}$

Letting $c$ be the sum of the lengths of $DE$ and $ED$:

$c = \sqrt{a^2 + x^2} + \sqrt{(b - x)^2 + (a - x)^2}$

  • 2
    The quartic formula [see http://en.wikipedia.org/wiki/Quartic_function ] says that, yes, you can solve such an equation explicitly. Wolfram Alpha says, yes, but it's ugly! http://www.wolframalpha.com/input/?i=x%5E4%2B(%E2%88%92a%E2%88%92b)x%5E3%2B(a%5E2%2Bab%2B2b%5E2%E2%88%92c%5E2)x%5E2%2B(%E2%88%92ab%5E2%E2%88%92b%5E3)x%2B(%E2%88%92a%5E2c%5E2%2Bb%5E4%2Bc%5E4)%3D0&t=crmtb01 – Bill Cook Jan 28 '14 at 02:49
  • Thank you! Maybe this is a sign that I need to find a more elegant solution. – ichorallemande Jan 28 '14 at 03:07
  • 1
    Yes. There may be a more elegant way to solve your problem. Brute force doesn't seem promising. :( – Bill Cook Jan 28 '14 at 03:12
  • 1
    Your equation is nice, its derivative is quite simple and the analytical solution (as provided by WA and other) is just awful. So, as suggested already by Bill Cook, solve the problem numerically with Newton. – Claude Leibovici Jan 28 '14 at 06:29

1 Answers1

1

It can, but the solution is very ugly (see wolframalpha's solution), and I feel like what you're doing may be over-complicating it. I would use an approximation from Newton's Method for efficiency.

qwr
  • 10,716