Kitonum

16053 Reputation

24 Badges

12 years, 199 days

MaplePrimes Activity


These are questions asked by Kitonum

It is well known that  operating in  geometry  package when setting objects symbolically some inconveniences arise. The error occurs if you do not set limits on the parameters. I wrote the procedure for finding center and radius of the circumscribed circle, devoid of drawbacks:

restart;

Circumcircle:=proc(a,b,c)

local x1, y1, x2, y2, x3, y3, n;

uses geometry;

x1,y1:=op(a); x2,y2:=op(b); x3,y3:=op(c);

n:=x2*y3-x3*y2+x3*y1-x1*y3+x1*y2-x2*y1;

point(A,a), point(B,b), point(C,c);

if type(n,realcons) then triangle(T,[A,B,C]); circumcircle(cc,T,'centername'=OO);

return [coordinates(OO),radius(cc)]  else assume(n<>0);

triangle(T,[A,B,C]); circumcircle(cc,T,'centername'=OO);

simplify([coordinates(OO),radius(cc)]); fi;

end proc:

 

At initial startup procedure works correctly:

Circumcircle([x1,y1], [x2,y2], [x3,y3]);

 

 

But if you change the arguments of the procedure, an error occurs:

Circumcircle([x1,1], [x2,y2], [x3,y3]);

 

But if you run the procedure again with the same arguments, the error disappears:

Circumcircle([x1,1], [x2,y2], [x3,y3]);

 

What is the reason?

Circumcircle.mws

Obviously, that  f:=x->x^3  is the same function as  g:=t->t^3 . But

f:= x-> x^3;  g:= t-> t^3;

is(f=g);

 

Worse yet

f:= x-> x^3;  g:= x-> x^3;

is(f=g);

Is there some sort of analog of  option  discont=true  in  plot3d?  Can I remove these vertical cylindrical surfaces in the following example? They correspond to the zeros of the denominator:

plot3d((x^2+sin(x))/(y^2+cos(x)), x = -7 .. 7, y = -5 .. 5, view = [-7 .. 7, -6 .. 6, -1 .. 7], numpoints = 50000, scaling = constrained, axes = normal);

plots[implicitplot](y^2+cos(x), x = -7 .. 7, y = -5 .. 5, scaling = constrained, numpoints = 5000);

 

 

Is it possible to use Unicode characters in  textplot  command? In the application that I'm developing, the signs of the chess pieces should be used.

Two examples:

for i in {1, 2/0, -3, 1/4, 5} do

if i::posint then print(i)  fi;

od;

       Error, numeric exception: division by zero

 

select(x->is(x::posint), {1, 2/0, -3, 1/4, 5});

       Error, numeric exception: division by zero

 

How to avoid interruption of the program in such cases?

4 5 6 7 8 Page 6 of 8