Question: Center and radiius of a circle in 3d

restart;
_local(D, O);
with(Student:-MultivariateCalculus);
A := [0, 0, 0];
B := [a, 0, 0];
C := [a, b, 0];
D := [0, b, 0];
S := [0, 0, h];
O := [x, y, z];
lineSC := Line(S, C);
lineSD := Line(S, D);
H := Projection(A, lineSC);
K := Projection(A, lineSD);
OH := H - O;
OK := K - O;
OC := C - O;
M := Matrix([OH, OK, OC]);
O := eval(O, %);
R := simplify(Distance(O, H));
                               O

Student:-MultivariateCalculus:-LineApplyFunction([0,0,h],

  [Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(a, 

  rowalign = "", columnalign = "", groupalign = "", 

  rowspan = "1", columnspan = "1"), rowalign = "", 

  columnalign = "", groupalign = ""), Typesetting:-mtr(

  Typesetting:-mtd(b, rowalign = "", columnalign = "", 

  groupalign = "", rowspan = "1", columnspan = "1"), 

  rowalign = "", columnalign = "", groupalign = ""), 

  Typesetting:-mtr(Typesetting:-mtd(uminus0h, rowalign = "", 

  columnalign = "", groupalign = "", rowspan = "1", 

  columnspan = "1"), rowalign = "", columnalign = "", 

  groupalign = ""), foreground = "[0,0,0]", readonly = "false", 

  align = "axis", rowalign = "baseline", columnalign = "center", 

  groupalign = "{left}", alignmentscope = "true", 

  columnwidth = "auto", width = "auto", rowspacing = "1.0ex", 

  columnspacing = "0.8em", rowlines = "none", 

  columnlines = "none", frame = "none", 

  framespacing = "0.4em 0.5ex", equalrows = "false", 

  equalcolumns = "false", displaystyle = "false", side = "right", 

  minlabelspacing = "0.8em")],variables=[x,y,z],parameter=t,id=1)


Student:-MultivariateCalculus:-LineApplyFunction([0,0,h],

  [Typesetting:-mtable(Typesetting:-mtr(Typesetting:-mtd(0, 

  rowalign = "", columnalign = "", groupalign = "", 

  rowspan = "1", columnspan = "1"), rowalign = "", 

  columnalign = "", groupalign = ""), Typesetting:-mtr(

  Typesetting:-mtd(b, rowalign = "", columnalign = "", 

  groupalign = "", rowspan = "1", columnspan = "1"), 

  rowalign = "", columnalign = "", groupalign = ""), 

  Typesetting:-mtr(Typesetting:-mtd(uminus0h, rowalign = "", 

  columnalign = "", groupalign = "", rowspan = "1", 

  columnspan = "1"), rowalign = "", columnalign = "", 

  groupalign = ""), foreground = "[0,0,0]", readonly = "false", 

  align = "axis", rowalign = "baseline", columnalign = "center", 

  groupalign = "{left}", alignmentscope = "true", 

  columnwidth = "auto", width = "auto", rowspacing = "1.0ex", 

  columnspacing = "0.8em", rowlines = "none", 

  columnlines = "none", frame = "none", 

  framespacing = "0.4em 0.5ex", equalrows = "false", 

  equalcolumns = "false", displaystyle = "false", side = "right", 

  minlabelspacing = "0.8em")],variables=[x,y,z],parameter=t,id=2)


               /     2            2         / 2    2\ /
               |    h  a         h  b     h \a  + b / |
        HAssign|------------,------------,------------|
               | 2    2    2  2    2    2  2    2    2|
               \a  + b  + h  a  + b  + h  a  + b  + h \

                          /    2         2  /
                          |   h  b    h b   |
                   KAssign|0,-------,-------|
                          |   2    2  2    2|
                          \  b  + h  b  + h \

        /                2                       2               
        |               h  a                    h  b             
OHAssign|uminus0x + ------------,uminus0y + ------------,uminus0z
        |            2    2    2             2    2    2         
        \           a  + b  + h             a  + b  + h          

       / 2    2\ /
     h \a  + b / |
   + ------------|
      2    2    2|
     a  + b  + h \


            /                      2                    2  /
            |                     h  b               h b   |
    OKAssign|uminus0x,uminus0y + -------,uminus0z + -------|
            |                     2    2             2    2|
            \                    b  + h             b  + h \

          OCAssign(uminus0x + a,uminus0y + b,uminus0z)

M := Matrix(3, 3, {(1, 1) = Typesetting:-mrow(Typesetting:-mo("&\

  uminus0;"), Typesetting:-mi("x"), Typesetting:-mo("+"), 

   Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-msup(Typese\

  tting:-mi("h"), Typesetting:-mn("2")), Typesetting:-mo("&Invis\

  ibleTimes;"), Typesetting:-mi("a")), Typesetting:-mrow(Typeset\

  ting:-msup(Typesetting:-mi("a"), Typesetting:-mn("2")), 

   Typesetting:-mo("+"), Typesetting:-msup(Typesetting:-mi(\

  "b"), Typesetting:-mn("2")), Typesetting:-mo("+"), 

   Typesetting:-msup(Typesetting:-mi("h"), Typesetting:-mn("2"))\

  ))), (1, 2) = Typesetting:-mrow(Typesetting:-mo("&uminus0;"), 

   Typesetting:-mi("y"), Typesetting:-mo("+"), Typesetting:\

  -mfrac(Typesetting:-mrow(Typesetting:-msup(Typesetting:-mi("h"\

  ), Typesetting:-mn("2")), Typesetting:-mo("⁢"),\

   Typesetting:-mi("b")), Typesetting:-mrow(Typesetting:-msup(Ty\

  pesetting:-mi("a"), Typesetting:-mn("2")), Typesetting:-mo("&p\

  lus;"), Typesetting:-msup(Typesetting:-mi("b"), Typesetting:-m\

  n("2")), Typesetting:-mo("+"), Typesetting:-msup(Typesett\

  ing:-mi("h"), Typesetting:-mn("2"))))), (1, 3) = Typesetting:-\

  mrow(Typesetting:-mo("&uminus0;"), Typesetting:-mi("z"), 

   Typesetting:-mo("+"), Typesetting:-mfrac(Typesetting:-mr\

  ow(Typesetting:-mi("h"), Typesetting:-mo("⁢"), 

   Typesetting:-mfenced(Typesetting:-mrow(Typesetting:-msup(Type\

  setting:-mi("a"), Typesetting:-mn("2")), Typesetting:-mo("&plu\

  s;"), Typesetting:-msup(Typesetting:-mi("b"), Typesetting:-mn(\

  "2"))))), Typesetting:-mrow(Typesetting:-msup(Typesetting:-mi(\

  "a"), Typesetting:-mn("2")), Typesetting:-mo("+"), 

   Typesetting:-msup(Typesetting:-mi("b"), Typesetting:-mn("2"))\

  , Typesetting:-mo("+"), Typesetting:-msup(Typesetting:-mi\

  ("h"), Typesetting:-mn("2"))))), (2, 1) = Typesetting:-mrow(Ty\

  pesetting:-mo("&uminus0;"), Typesetting:-mi("x")), (2, 2) = 

   Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-\

  mi("y"), Typesetting:-mo("+"), Typesetting:-mfrac(Typeset\

  ting:-mrow(Typesetting:-msup(Typesetting:-mi("h"), 

   Typesetting:-mn("2")), Typesetting:-mo("⁢"), 

   Typesetting:-mi("b")), Typesetting:-mrow(Typesetting:-msup(Ty\

  pesetting:-mi("b"), Typesetting:-mn("2")), Typesetting:-mo("&p\

  lus;"), Typesetting:-msup(Typesetting:-mi("h"), Typesetting:-m\

  n("2"))))), (2, 3) = Typesetting:-mrow(Typesetting:-mo("&uminu\

  s0;"), Typesetting:-mi("z"), Typesetting:-mo("+"), 

   Typesetting:-mfrac(Typesetting:-mrow(Typesetting:-mi("h"), 

   Typesetting:-mo("⁢"), Typesetting:-msup(Typese\

  tting:-mi("b"), Typesetting:-mn("2"))), Typesetting:-mrow(Type\

  setting:-msup(Typesetting:-mi("b"), Typesetting:-mn("2")), 

   Typesetting:-mo("+"), Typesetting:-msup(Typesetting:-mi(\

  "h"), Typesetting:-mn("2"))))), (3, 1) = Typesetting:-mrow(Typ\

  esetting:-mo("&uminus0;"), Typesetting:-mi("x"), Typesetting:-\

  mo("+"), Typesetting:-mi("a")), (3, 2) = Typesetting:-mro\

  w(Typesetting:-mo("&uminus0;"), Typesetting:-mi("y"), 

   Typesetting:-mo("+"), Typesetting:-mi("b")), (3, 3) = 

   Typesetting:-mrow(Typesetting:-mo("&uminus0;"), Typesetting:-\

  mi("z"))})


Error, invalid input: eval received Matrix(3, 3, {(1, 1) = -x+h^2*a/(a^2+b^2+h^2), (1, 2) = -y+h^2*b/(a^2+b^2+h^2), (1, 3) = -z+h*(a^2+b^2)/(a^2+b^2+h^2), (2, 1) = -x, (2, 2) = -y+h^2*b/(b^2+h^2), (2, 3) = -z+h*b^2/(b^2+h^2), (3, 1) = -x+a, (3, 2) = -y+b, (3, 3) = -z}), which is not valid for its 2nd argument, eqns
       /     1       / 2  2      2        2  2    2  2    2  2
  R := |------------ \a  h  - 2 a  h z + a  x  + a  y  + a  z 
       | 2    2    2                                          
       \a  + b  + h                                           

            2      2  2      2        2  2    2  2    2  2
     - 2 a h  x + b  h  - 2 b  h z + b  x  + b  y  + b  z 

            2      2  2    2  2    2  2\\      
     - 2 b h  y + h  x  + h  y  + h  z /|^(1/2)
                                        |      
                                        /      
Why this error ? Thank you.

Please Wait...