I define a function that can calculate the equation of a conic section with five given points.
ConicThrough5Points[a_, b_, c_, d_, e_, x_, y_] :=
Block[{conic, coniceqn, a1, b1, c1, d1, e1},
conic = (a1 x^2 + b1 x y + c1 y^2 + d1 x + e1 y + 1 ==
0) /. {{x -> a[[1]], y -> a[[2]]}, {x -> b[[1]],
y -> b[[2]]}, {x -> c[[1]], y -> c[[2]]}, {x -> d[[1]],
y -> d[[2]]}, {x -> e[[1]], y -> e[[2]]}};
coniceqn = (a1 x^2 + b1 x y + c1 y^2 + d1 x + e1 y + 1 == 0) /.
Solve[conic, {a1, b1, c1, d1, e1}][[1]]; Return[coniceqn]];
then I calculate the function with five points, but it doesn't work. I don`t know why.
ConicThrough5Points[{0, 0}, {1, 0}, {0, 1}, {1, 1}, {-1/2, 3/2}, x, y]
Part::partw: Part 1 of {} does not exist. >>
ReplaceAll::reps: "{{}[[1]]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.
ReplaceAll::reps: "{{}[[1]]} is neither a list of replacement rules nor a valid dispatch table, and so cannot be used for replacing.