Hi,
I want to check whether an expression represents a circle in the
xy-plane,
but I don't understand the behavior of the pattern matching:
(%i2) matchdeclare([xx,yy],numberp,rr,lambda([u],numberp(u) and u >
0));
(%o2) done
There is no match with the "+" sign in the expression:
(%i3) defmatch(circlep,(y-yy)^2 + (x-xx)^2 = rr);
(%o3) circlep
(%i4) circlep((y-3)^2+(x-2)^2 = 25);
(%o4) false
There is a match with a "-"-sign in the expression
(that is, of course, no circle; but the matching is done in
the expected way):
(%i5) defmatch(circlep1,(x-xx)^2 - (y-yy)^2 = rr);
(%o5) circlep1
(%i6) circlep1((x-2)^2-(y-3)^2 = 25);
(%o6) [rr = 25,yy = 3,xx = 2]
Is there any explanation for that behavior,
or could it be possible, that pattern matching is just not
yet mature in Maxima?
Is there a possibility to conceive a pattern for recognizing a circle?
Thanks in advance
Wilhelm