Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Maxima questions and issues

  1. Feb 11, 2015 #1
    for:
    Code (Text):
    solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd]);
    the output is simply : []

    I want it to solve the system :

    k2=(xA-xD)2 + (yA-yD)2
    k2=(xB-xD)2 + (yB-yD)2
    k2=(xC-xD)2 + (yC-yD)2

    for xD and yD.

    I already solved it by hand but wanted to test Maxima with it.

    What am I doing wrong?
     
  2. jcsd
  3. Feb 12, 2015 #2

    fluidistic

    User Avatar
    Gold Member

    Instead of asking the value of only 2 unknowns, if you instead ask the value of the 9 unknowns you get
    Code (Text):

    (%i4) solve([k^2=(xa-xd)^2+(ya-yd)^2,k^2=(xb-xd)^2+(yb-yd)^2,k^2=(xc-xd)^2+(yc-yd)^2],[xd,yd,xa,xb,xc,yb,yc,k,ya]);
    (%o4) [[xd = %r1, yd = %r2, xa = %r3, xb = %r4, xc = %r5, yb = %r6,
      2  2  2  2
    yc = sqrt(%r6  - 2 %r2 %r6 - %r5  + %r1 (2 %r5 - 2 %r4) + %r4  + %r2 ) + %r2,
      2  2  2  2
    k = sqrt(%r6  - 2 %r2 %r6 + %r4  - 2 %r1 %r4 + %r2  + %r1 ),
      2  2  2  2
    ya = sqrt(%r6  - 2 %r2 %r6 + %r4  + %r1 (2 %r3 - 2 %r4) - %r3  + %r2 ) + %r2],
    [xd = %r7, yd = %r8, xa = %r9, xb = %r10, xc = %r11, yb = %r12,
      2  2  2  2
    yc = sqrt(%r8  - 2 %r12 %r8 + (2 %r11 - 2 %r10) %r7 + %r12  - %r11  + %r10 )
      2  2  2  2
    + %r8, k = sqrt(%r8  - 2 %r12 %r8 + %r7  - 2 %r10 %r7 + %r12  + %r10 ),
      2  2  2
    ya = %r8 - sqrt(- %r9  + %r7 (2 %r9 - 2 %r10) + %r8  - 2 %r12 %r8 + %r12
      2
    + %r10 )], [xd = %r13, yd = %r14, xa = %r15, xb = %r16, xc = %r17, yb = %r18,
      2  2  2  2
    yc = sqrt(%r18  - 2 %r14 %r18 - %r17  + %r13 (2 %r17 - 2 %r16) + %r16  + %r14 )
      2  2  2
    + %r14, k = - sqrt(%r18  - 2 %r14 %r18 + %r16  - 2 %r13 %r16 + %r14
      2  2  2
    + %r13 ), ya = sqrt(%r18  - 2 %r14 %r18 + %r16  + %r13 (2 %r15 - 2 %r16)
      2  2
    - %r15  + %r14 ) + %r14], [xd = %r19, yd = %r20, xa = %r21, xb = %r22,
      2  2
    xc = %r23, yb = %r24, yc = sqrt(%r24  - 2 %r20 %r24 - %r23
      2  2
    + %r19 (2 %r23 - 2 %r22) + %r22  + %r20 ) + %r20,
      2  2  2  2
    k = - sqrt(%r24  - 2 %r20 %r24 + %r22  - 2 %r19 %r22 + %r20  + %r19 ),
      2  2  2
    ya = %r20 - sqrt(%r24  - 2 %r20 %r24 + %r22  + %r19 (2 %r21 - 2 %r22) - %r21
      2
    + %r20 )], [xd = %r25, yd = %r26, xa = %r27, xb = %r28, xc = %r29, yb = %r30,
      2  2  2
    yc = %r26 - sqrt(%r30  - 2 %r26 %r30 - %r29  + %r25 (2 %r29 - 2 %r28) + %r28
      2  2  2  2
    + %r26 ), k = sqrt(%r30  - 2 %r26 %r30 + %r28  - 2 %r25 %r28 + %r26
      2  2  2
    + %r25 ), ya = sqrt(%r30  - 2 %r26 %r30 + %r28  + %r25 (2 %r27 - 2 %r28)
      2  2
    - %r27  + %r26 ) + %r26], [xd = %r31, yd = %r32, xa = %r33, xb = %r34,
      2  2
    xc = %r35, yb = %r36, yc = %r32 - sqrt(%r36  - 2 %r32 %r36 - %r35
      2  2
    + %r31 (2 %r35 - 2 %r34) + %r34  + %r32 ),
      2  2  2  2
    k = sqrt(%r36  - 2 %r32 %r36 + %r34  - 2 %r31 %r34 + %r32  + %r31 ),
      2  2  2
    ya = %r32 - sqrt(%r36  - 2 %r32 %r36 + %r34  + %r31 (2 %r33 - 2 %r34) - %r33
      2
    + %r32 )], [xd = %r37, yd = %r38, xa = %r39, xb = %r40, xc = %r41, yb = %r42,
      2  2  2
    yc = %r38 - sqrt(%r42  - 2 %r38 %r42 - %r41  + %r37 (2 %r41 - 2 %r40) + %r40
      2  2  2  2
    + %r38 ), k = - sqrt(%r42  - 2 %r38 %r42 + %r40  - 2 %r37 %r40 + %r38
      2  2  2
    + %r37 ), ya = sqrt(%r42  - 2 %r38 %r42 + %r40  + %r37 (2 %r39 - 2 %r40)
      2  2
    - %r39  + %r38 ) + %r38], [xd = %r43, yd = %r44, xa = %r45, xb = %r46,
      2  2
    xc = %r47, yb = %r48, yc = %r44 - sqrt(%r48  - 2 %r44 %r48 - %r47
      2  2
    + %r43 (2 %r47 - 2 %r46) + %r46  + %r44 ),
      2  2  2  2
    k = - sqrt(%r48  - 2 %r44 %r48 + %r46  - 2 %r43 %r46 + %r44  + %r43 ),
      2  2  2
    ya = %r44 - sqrt(%r48  - 2 %r44 %r48 + %r46  + %r43 (2 %r45 - 2 %r46) - %r45
      2
    + %r44 )]]

     
    From there I guess you could reach the result you got by hand if you used some substitution or eval() function but I am not skilled enough with Maxima to do it (yet at least).
     
  4. Feb 13, 2015 #3
    Hello, thank you very much for the insight. That actually never occurred to me. It does churn out stuff if I give it that. However, I can't really make sense of the output. And I can't find the solution I was expecting anywhere in the output. The solution I got was actually pretty neat and elegant.

    Only xD and yD are unknowns and I need it to solve the system for them, with the other variables treated as knowns.

    What are all those %r's followed by numbers?

    I assumed that if I requested it solve the system for xD and yD that it would treat those as knowns and the other variables as unknowns and solve in terms of them.
     
    Last edited: Feb 13, 2015
  5. Feb 13, 2015 #4

    fluidistic

    User Avatar
    Gold Member

    I guess Maxima can yield your neat solution if we entered another command(s). Maxima has a mailing list which is like a forum in which you could ask your questions, I'm sure people experienced would reply to you in a few hours at most.
    From what I understand in the output, Maxima seems to assign %r1 to xd and other %r_i's to other variables, then perform some calculations and then assign other %r_i's to other variables, etc.
    So to get your answer which is xd = %r43, yd = %r44 , you'd have to substitute back what are %r43 and %r44. Surely there must be a way to do this with a simle command, but I am new to Maxima and don't know about it.


    Edit: I suggest you to post your problem in the mailing list. I've read that when [] is returned it means that Maxima cannot find a solution (so there's great chances that the solution does not exist). I don't understand then how come it returns something when you ask for the 9 variables.
     
    Last edited: Feb 13, 2015
  6. Feb 13, 2015 #5
    There is a solution. And it's quite neat and elegant. The solutions for xD and yD are the equations for the coordinates of the centre of the circle circumscribed to the triangle whose tips are defined by points A (xA, yA), B (xB, yB) and C (xC, yC). K is the radius of the circumscribed circle.

    Thank you very much for all the help. You've made things much clearer and have been a lot of help.

    Unfortunately, I'm not all that interested in spending the time to learn maxima. Especially if it cannot even find the solution to that simple system (there is one) without me doing half or more of the work for it.

    But this is what I've come to expect after having tried several CAS software including Mathematica, MathCAD, Reduce and Sage.
     
  7. Feb 13, 2015 #6

    fluidistic

    User Avatar
    Gold Member

    Yes learning a CAS does not seem an easy task. Now that you've described the problem, Maxima will never know that K is not independent of the tips A, B and C. So maybe if you define K in terms of xa, ya, xb, yb, xc and yc then Maxima would return the value that you expect.


    Edit: The %r_i's are parameters I think. They come from because when I asked the values for 9 variables Maxima tried to solve 3 equations with 9 unknown which yield infinitely many solutions, hence the free parameters.
    In the 1st post you asked for 2 values so Maxima solved the system of 3 equations with 2 unknowns which yielded an overdetermined system that leads to no solution and I believe Maxima was correct in returning [].
     
    Last edited: Feb 13, 2015
  8. Feb 13, 2015 #7

    fluidistic

    User Avatar
    Gold Member

    News! So you have 3 equations and so you want 3 unknowns!!!
    Let's say that, as you said, want to determine the coordinates of the center of the cicumscribed circle. Now assume that you also want to know the radius of such circle. Then you ask to Maxima:
    Code (Text):
    (%i1) solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd,k]);
      2  2  2  2  2  2
    (%o1) [[xd = - ((yb - ya) yc  + (- yb  + ya  - xb  + xa ) yc + ya yb
      2  2  2  2  2
     + (- ya  + xc  - xa ) yb + (xb  - xc ) ya)
    /((2 xb - 2 xa) yc + (2 xa - 2 xc) yb + (2 xc - 2 xb) ya),
      2  2  2  2
    yd = ((xb - xa) yc  + (xa - xc) yb  + (xc - xb) ya  + (xb - xa) xc
      2  2  2  2
     + (xa  - xb ) xc + xa xb  - xa  xb)/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
      2  4  4  2  4  2  4
     + (2 xc - 2 xb) ya), k = - sqrt(yb  yc  - 2 ya yb yc  + ya  yc  + xb  yc
      4  2  4  3  3  2  3  2  3
     - 2 xa xb yc  + xa  yc  - 2 yb  yc  + 2 ya yb  yc  + 2 ya  yb yc
      2  3  3  2  3  3  3  2  3
     - 2 xb  yb yc  + 4 xa xb yb yc  - 2 xa  yb yc  - 2 ya  yc  - 2 xb  ya yc
      3  2  3  4  2  3  2  2  2  2
     + 4 xa xb ya yc  - 2 xa  ya yc  + yb  yc  + 2 ya yb  yc  - 6 ya  yb  yc
      2  2  2  2  2  2  2  2  2  2
     + 2 xc  yb  yc  - 2 xb xc yb  yc  - 2 xa xc yb  yc  + 2 xb  yb  yc
      2  2  2  2  2  3  2  2  2
     - 2 xa xb yb  yc  + 2 xa  yb  yc  + 2 ya  yb yc  - 4 xc  ya yb yc
      2  2  2  2  2
     + 4 xb xc ya yb yc  + 4 xa xc ya yb yc  + 2 xb  ya yb yc  - 8 xa xb ya yb yc
      2  2  4  2  2  2  2  2  2
     + 2 xa  ya yb yc  + ya  yc  + 2 xc  ya  yc  - 2 xb xc ya  yc
      2  2  2  2  2  2  2  2  2  2
     - 2 xa xc ya  yc  + 2 xb  ya  yc  - 2 xa xb ya  yc  + 2 xa  ya  yc
      2  2  2  2  2  2  2  2  3  2
     + 2 xb  xc  yc  - 4 xa xb xc  yc  + 2 xa  xc  yc  - 2 xb  xc yc
      2  2  2  2  3  2  4  2  3  2
     + 2 xa xb  xc yc  + 2 xa  xb xc yc  - 2 xa  xc yc  + xb  yc  - 2 xa xb  yc
      2  2  2  3  2  4  2  4  2  3
     + 2 xa  xb  yc  - 2 xa  xb yc  + xa  yc  - 2 ya yb  yc + 2 ya  yb  yc
      2  3  3  2  3  3  2
     - 2 xc  yb  yc + 4 xa xc yb  yc - 2 xa  yb  yc + 2 ya  yb  yc
      2  2  2  2  2  2
     + 2 xc  ya yb  yc + 4 xb xc ya yb  yc - 8 xa xc ya yb  yc - 4 xb  ya yb  yc
      2  2  2  4  2  2
     + 4 xa xb ya yb  yc + 2 xa  ya yb  yc - 2 ya  yb yc + 2 xc  ya  yb yc
      2  2  2  2  2
     - 8 xb xc ya  yb yc + 4 xa xc ya  yb yc + 2 xb  ya  yb yc + 4 xa xb ya  yb yc
      2  2  2  2  2  2  2
     - 4 xa  ya  yb yc - 2 xb  xc  yb yc + 4 xa xb xc  yb yc - 2 xa  xc  yb yc
      2  2  3  2  2
     + 4 xa xb  xc yb yc - 8 xa  xb xc yb yc + 4 xa  xc yb yc - 2 xa  xb  yb yc
      3  4  2  3  3  2  3
     + 4 xa  xb yb yc - 2 xa  yb yc - 2 xc  ya  yc + 4 xb xc ya  yc - 2 xb  ya  yc
      2  2  2  2  2  3
     - 2 xb  xc  ya yc + 4 xa xb xc  ya yc - 2 xa  xc  ya yc + 4 xb  xc ya yc
      2  2  4  3
     - 8 xa xb  xc ya yc + 4 xa  xb xc ya yc - 2 xb  ya yc + 4 xa xb  ya yc
      2  2  2  4  2  4  4  2  4  3  3
     - 2 xa  xb  ya yc + ya  yb  + xc  yb  - 2 xa xc yb  + xa  yb  - 2 ya  yb
      2  3  3  2  3  4  2  2  2  2
     - 2 xc  ya yb  + 4 xa xc ya yb  - 2 xa  ya yb  + ya  yb  + 2 xc  ya  yb
      2  2  2  2  2  2  2  2  2
     - 2 xb xc ya  yb  - 2 xa xc ya  yb  + 2 xb  ya  yb  - 2 xa xb ya  yb
      2  2  2  4  2  3  2  3  2  2  2  2
     + 2 xa  ya  yb  + xc  yb  - 2 xb xc  yb  - 2 xa xc  yb  + 2 xb  xc  yb
      2  2  2  2  2  2  2  2  2
     + 2 xa xb xc  yb  + 2 xa  xc  yb  - 4 xa xb  xc yb  + 2 xa  xb xc yb
      3  2  2  2  2  3  2  4  2  2  3
     - 2 xa  xc yb  + 2 xa  xb  yb  - 2 xa  xb yb  + xa  yb  - 2 xc  ya  yb
      3  2  3  4  3
     + 4 xb xc ya  yb - 2 xb  ya  yb - 2 xc  ya yb + 4 xb xc  ya yb
      3  2  2  2  2  2
     + 4 xa xc  ya yb - 2 xb  xc  ya yb - 8 xa xb xc  ya yb - 2 xa  xc  ya yb
      2  2  2  2  2  4
     + 4 xa xb  xc ya yb + 4 xa  xb xc ya yb - 2 xa  xb  ya yb + xc  ya
      4  2  4  4  2  3  2  3  2
     - 2 xb xc ya  + xb  ya  + xc  ya  - 2 xb xc  ya  - 2 xa xc  ya
      2  2  2  2  2  2  2  2  3  2
     + 2 xb  xc  ya  + 2 xa xb xc  ya  + 2 xa  xc  ya  - 2 xb  xc ya
      2  2  2  2  4  2  3  2  2  2  2
     + 2 xa xb  xc ya  - 4 xa  xb xc ya  + xb  ya  - 2 xa xb  ya  + 2 xa  xb  ya
      2  4  4  2  4  3  3  2  3  2  3
     + xb  xc  - 2 xa xb xc  + xa  xc  - 2 xb  xc  + 2 xa xb  xc  + 2 xa  xb xc
      3  3  4  2  3  2  2  2  2  3  2  4  2
     - 2 xa  xc  + xb  xc  + 2 xa xb  xc  - 6 xa  xb  xc  + 2 xa  xb xc  + xa  xc
      4  2  3  3  2  4  2  4
     - 2 xa xb  xc + 2 xa  xb  xc + 2 xa  xb  xc - 2 xa  xb xc + xa  xb
      3  3  4  2
     - 2 xa  xb  + xa  xb )/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
      2  2  2  2  2
     + (2 xc - 2 xb) ya)], [xd = - ((yb - ya) yc  + (- yb  + ya  - xb  + xa ) yc
      2  2  2  2  2  2
     + ya yb  + (- ya  + xc  - xa ) yb + (xb  - xc ) ya)
    /((2 xb - 2 xa) yc + (2 xa - 2 xc) yb + (2 xc - 2 xb) ya),
      2  2  2  2
    yd = ((xb - xa) yc  + (xa - xc) yb  + (xc - xb) ya  + (xb - xa) xc
      2  2  2  2
     + (xa  - xb ) xc + xa xb  - xa  xb)/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
      2  4  4  2  4  2  4
     + (2 xc - 2 xb) ya), k = sqrt(yb  yc  - 2 ya yb yc  + ya  yc  + xb  yc
      4  2  4  3  3  2  3  2  3
     - 2 xa xb yc  + xa  yc  - 2 yb  yc  + 2 ya yb  yc  + 2 ya  yb yc
      2  3  3  2  3  3  3  2  3
     - 2 xb  yb yc  + 4 xa xb yb yc  - 2 xa  yb yc  - 2 ya  yc  - 2 xb  ya yc
      3  2  3  4  2  3  2  2  2  2
     + 4 xa xb ya yc  - 2 xa  ya yc  + yb  yc  + 2 ya yb  yc  - 6 ya  yb  yc
      2  2  2  2  2  2  2  2  2  2
     + 2 xc  yb  yc  - 2 xb xc yb  yc  - 2 xa xc yb  yc  + 2 xb  yb  yc
      2  2  2  2  2  3  2  2  2
     - 2 xa xb yb  yc  + 2 xa  yb  yc  + 2 ya  yb yc  - 4 xc  ya yb yc
      2  2  2  2  2
     + 4 xb xc ya yb yc  + 4 xa xc ya yb yc  + 2 xb  ya yb yc  - 8 xa xb ya yb yc
      2  2  4  2  2  2  2  2  2
     + 2 xa  ya yb yc  + ya  yc  + 2 xc  ya  yc  - 2 xb xc ya  yc
      2  2  2  2  2  2  2  2  2  2
     - 2 xa xc ya  yc  + 2 xb  ya  yc  - 2 xa xb ya  yc  + 2 xa  ya  yc
      2  2  2  2  2  2  2  2  3  2
     + 2 xb  xc  yc  - 4 xa xb xc  yc  + 2 xa  xc  yc  - 2 xb  xc yc
      2  2  2  2  3  2  4  2  3  2
     + 2 xa xb  xc yc  + 2 xa  xb xc yc  - 2 xa  xc yc  + xb  yc  - 2 xa xb  yc
      2  2  2  3  2  4  2  4  2  3
     + 2 xa  xb  yc  - 2 xa  xb yc  + xa  yc  - 2 ya yb  yc + 2 ya  yb  yc
      2  3  3  2  3  3  2
     - 2 xc  yb  yc + 4 xa xc yb  yc - 2 xa  yb  yc + 2 ya  yb  yc
      2  2  2  2  2  2
     + 2 xc  ya yb  yc + 4 xb xc ya yb  yc - 8 xa xc ya yb  yc - 4 xb  ya yb  yc
      2  2  2  4  2  2
     + 4 xa xb ya yb  yc + 2 xa  ya yb  yc - 2 ya  yb yc + 2 xc  ya  yb yc
      2  2  2  2  2
     - 8 xb xc ya  yb yc + 4 xa xc ya  yb yc + 2 xb  ya  yb yc + 4 xa xb ya  yb yc
      2  2  2  2  2  2  2
     - 4 xa  ya  yb yc - 2 xb  xc  yb yc + 4 xa xb xc  yb yc - 2 xa  xc  yb yc
      2  2  3  2  2
     + 4 xa xb  xc yb yc - 8 xa  xb xc yb yc + 4 xa  xc yb yc - 2 xa  xb  yb yc
      3  4  2  3  3  2  3
     + 4 xa  xb yb yc - 2 xa  yb yc - 2 xc  ya  yc + 4 xb xc ya  yc - 2 xb  ya  yc
      2  2  2  2  2  3
     - 2 xb  xc  ya yc + 4 xa xb xc  ya yc - 2 xa  xc  ya yc + 4 xb  xc ya yc
      2  2  4  3
     - 8 xa xb  xc ya yc + 4 xa  xb xc ya yc - 2 xb  ya yc + 4 xa xb  ya yc
      2  2  2  4  2  4  4  2  4  3  3
     - 2 xa  xb  ya yc + ya  yb  + xc  yb  - 2 xa xc yb  + xa  yb  - 2 ya  yb
      2  3  3  2  3  4  2  2  2  2
     - 2 xc  ya yb  + 4 xa xc ya yb  - 2 xa  ya yb  + ya  yb  + 2 xc  ya  yb
      2  2  2  2  2  2  2  2  2
     - 2 xb xc ya  yb  - 2 xa xc ya  yb  + 2 xb  ya  yb  - 2 xa xb ya  yb
      2  2  2  4  2  3  2  3  2  2  2  2
     + 2 xa  ya  yb  + xc  yb  - 2 xb xc  yb  - 2 xa xc  yb  + 2 xb  xc  yb
      2  2  2  2  2  2  2  2  2
     + 2 xa xb xc  yb  + 2 xa  xc  yb  - 4 xa xb  xc yb  + 2 xa  xb xc yb
      3  2  2  2  2  3  2  4  2  2  3
     - 2 xa  xc yb  + 2 xa  xb  yb  - 2 xa  xb yb  + xa  yb  - 2 xc  ya  yb
      3  2  3  4  3
     + 4 xb xc ya  yb - 2 xb  ya  yb - 2 xc  ya yb + 4 xb xc  ya yb
      3  2  2  2  2  2
     + 4 xa xc  ya yb - 2 xb  xc  ya yb - 8 xa xb xc  ya yb - 2 xa  xc  ya yb
      2  2  2  2  2  4
     + 4 xa xb  xc ya yb + 4 xa  xb xc ya yb - 2 xa  xb  ya yb + xc  ya
      4  2  4  4  2  3  2  3  2
     - 2 xb xc ya  + xb  ya  + xc  ya  - 2 xb xc  ya  - 2 xa xc  ya
      2  2  2  2  2  2  2  2  3  2
     + 2 xb  xc  ya  + 2 xa xb xc  ya  + 2 xa  xc  ya  - 2 xb  xc ya
      2  2  2  2  4  2  3  2  2  2  2
     + 2 xa xb  xc ya  - 4 xa  xb xc ya  + xb  ya  - 2 xa xb  ya  + 2 xa  xb  ya
      2  4  4  2  4  3  3  2  3  2  3
     + xb  xc  - 2 xa xb xc  + xa  xc  - 2 xb  xc  + 2 xa xb  xc  + 2 xa  xb xc
      3  3  4  2  3  2  2  2  2  3  2  4  2
     - 2 xa  xc  + xb  xc  + 2 xa xb  xc  - 6 xa  xb  xc  + 2 xa  xb xc  + xa  xc
      4  2  3  3  2  4  2  4
     - 2 xa xb  xc + 2 xa  xb  xc + 2 xa  xb  xc - 2 xa  xb xc + xa  xb
      3  3  4  2
     - 2 xa  xb  + xa  xb )/((2 xb - 2 xa) yc + (2 xa - 2 xc) yb
     + (2 xc - 2 xb) ya)]]
    Now I'm not sure how to simplify this. I'd appreciate if you could provide your answer by hand. Thanks.
     
  9. Feb 15, 2015 #8
    Sure thing. Here it is :

    https://drive.google.com/open?id=0BwJaCsyXIqEeME5FTF9pNXVKS1E&authuser=0

    Tested it empirically and it seems to be correct. If Maxima or some other CAS were able to do this for me it would spare both the initial work and the need for empirical testing.

    later edit:

    I can get the equation for the radius of the circumscribed circle by performing a Euclidean distance calculation from xD, yD to either one of A, B or C.

    If Maxima can't cut this it's pretty much useless for my purposes, unfortunately. So no point in learning it.

    But it doesn't mean it's bad compared to other CASes I tried (MathCAD, Mathematica, Sage, Reduce).

    They all pretty much suck, unfortunately. At least for my needs.

    But to be fair, the tests I had MathCAD, Mathematica, Sage do were more complex than this.

    even later edit:

    I gave them all the same test and they all ran out of memory, which leads me to believe they use similar algorithms or at least approaches.
     
    Last edited: Feb 15, 2015
  10. Feb 15, 2015 #9

    fluidistic

    User Avatar
    Gold Member

    Well in my last post Maxima gave the correct (and short) answer which is equivalent to the one you provided.
    The command to get it was
    Code (Text):
    solve([k^2=(xa-xd)^2 + (ya-yd)^2,k^2=(xb-xd)^2 + (yb-yd)^2,k^2=(xc-xd)^2 + (yc-yd)^2],[xd,yd,k]);
    When you use solve() and ask for n variables (in this case n=3), maxima assumes that there are n unknowns and that you want them expressed in terms of the other variables supposedly known. Initially you had a system of 3 equations and you explictly asked for only 2 unknowns so that mathematically you had a system of 3 equations with 2 unknown which is an overdetermined system that has no solution and Maxima was correct returning the empty list [].
    To overcome this problem I just asked to Maxima the values of the 3 unknowns xd, yd and k. Maxima was strong enough to return the correct result.

    The fact that one does not know well a CAS because it is hard to know does not mean that the CAS sucks, in my opinion. I am sure Maxima (as well as Maxima and others) are extremely powerful tools when one knows how to use them properly.

    By the way for a nicer looking output I use wxMaxima (maybe you use it too?).
    And here I post some commands if you want to check that both answers (yours and Maxima's) are equivalent:
    Your position for xd:
    Code (Text):
    xd(xa,xb,xc,ya,yb,yc):=(ya*(xc^2-xb^2+yc^2-yb^2)+yb*(xa^2-xc^2+ya^2-yc^2)+yc*(xb^2-xa^2+yb^2-ya^2))/(2*(xa*(yb-yc)+xb*(yc-ya)+xc*(ya-yb)));
    Maxima's position for xd :
    Code (Text):
    ome(xa,xb,xc,ya,yb,yc):=-((yb-ya)*yc^2+(-yb^2+ya^2-xb^2+xa^2)*yc+ya*yb^2+(-ya^2+xc^2-xa^2)*yb+(xb^2-xc^2)*ya)/((2*xb-2*xa)*yc+(2*xa-2*xc)*yb+(2*xc-2*xb)*ya);
    Checking some values :
    Code (Text):
    xd(1,2,3,4,6,7);
    $$\frac{13}{2}$$
    Maxima's:
    Code (Text):
    ome(1,2,3,4,6,7);
    $$\frac{13}{2}$$
    I also tested for other values and they both match.
     
  11. Feb 15, 2015 #10
    Wow. I don't know what to say. Except thanks! A lot! :smile:
     
  12. Feb 15, 2015 #11

    fluidistic

    User Avatar
    Gold Member

    No problem. I learned in the process :)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Maxima questions and issues
  1. Manual of Maxima (Replies: 11)

  2. Integrating in Maxima (Replies: 1)

Loading...