## 1157 Reputation

12 years, 151 days

## typeset check for value of 1 insde it...

Maple 2024

I need to check inside typeset to see is something evaluates to 1. I can find if something contains 1 and have been using that. But got caught out last night because I forgot my work around. e.g. 1+H contains 1 and my work around is `1+H` so the check doesn't see the 1. The typeset is always the first item in the list.

 > restart
 > foo:=proc(a,{S::list:=[]}) local i,perp::boolean; if S<>NULL then   if (S[1])=1 or S[1]::function and has(`or`(seq (op(S[1]),i=1..nops([op(S[1])]))),1)  then    #if (S[1])=1 or S[1]::function and `or`(seq (is(op(S[1][i]),1),i=1..nops([op(S[1])])))  then  ;#  not working          perp:=true;print(perp);     else      perp:=false;print(perp);   end if; end if; end proc:
 > foo(6,S=["cat"]);
 >
 (1)
 > foo(6,S=[1]);
 (2)
 > foo(6,S=[typeset("cat=",H/H),align={above,left},color=green]); #good
 (3)
 > foo(6,S=[typeset("cat=",H),align={above,left}])
 (4)
 > foo(6,S=[typeset("cat=",1+H)],align={above,left},color=green);#want to fix this
 >
 >
 (5)
 > foo(6,S=[typeset("cat=",`1+H`)]); #work around
 (6)
 > foo(6,S=[typeset("cat=",`B/(H+1)`)]); #work around
 (7)
 > foo(6,S=[typeset("cat=",`B/(H+1)`,"  height =",1)]); #correct
 (8)
 > foo(6,S=[typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)]); #correct
 (9)
 > op(typeset("cat=",B/(H+1)));# this would be false
 >
 (10)
 > op(typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)) ;  # this would be true
 >
 >
 (11)

## Can A3 print size be installed for Maple...

Maple 2024

I would like to print my help pages to pdf. Is there a way to install A3 paper size. That would help in maintaining the layout as seen on the screen.

Maybe there is an alternative approach.

## How to select element with z=0...

Maple 2024

Have a list of four projective points. I need to check that they are colinear projectively. If one point is at infinity i.e. 0 in z position I can chech if combination of cross product and dot product is 0.
a)  What is a good way to find if one ot the four has zero in z position?

b) Having found that is there a neat way of piching the next two/three points by making the count wrap automatically. e.g 3  then 4,5,6 i.e. 3,4,1,2

 (1)

 (2)

 (3)

## Intersectplot line quality ...

Maple 2024

I am using intersectplot  to make projective coordinate plots. Everything intersects the plane z=1. I find the plot quality poor, i.e. dotty dashy lines and circle. This seem to be the best linestyle=solid can do here. gridrefine can't be applied here.
Any suggestions to improve quality here?
Maybe intersectplot is not the best aprroach here but so far it is all if have figured out.

 > restart
 >
 >
 > with(plottools)
 (1)
 > with(plots)
 (2)
 >
 >
 > DistCircle:=x^2+y^2=1
 (3)
 > pt1:=[1/4,3/4]
 (4)
 > pt2:=[7/8,-1/3]
 (5)
 > pt3:=[-3/2,3/7]
 (6)
 > pt4:=[3/5,-4/5]
 (7)
 > pt5:=[-1/10,-3/2]
 (8)
 >
 > L12:=-(13*x)/12 - (5*y)/8 + 71/96; #LnPeqns(pt1,pt2);
 (9)
 > L13:=-(9*x)/28 + (7*y)/4 - 69/56; #LnPeqns(pt1,pt3);
 (10)
 > L23:=(16*x)/21 + (19*y)/8 + 1/8; #LnPeqns(pt2,pt3);
 (11)
 > L35:=(27*x)/14 + (7*y)/5 + 321/140; #LnPeqns(pt5,pt3)
 (12)
 > nullline:=3/5*x-4/5*y-1
 (13)
 > ptplt:=point([pt1,pt2,pt3,pt4,pt5],color="Green",symbol=solidcircle,symbolsize=10): txtplt:=textplot([pt4[],typeset("pt4")],align={below,right}):
 > plt1:=display(txtplt,implicitplot([DistCircle,L12,L13,L23,L35,nullline],x=-2..2,y=-1.5...1.5,color=[red,blue,blue,blue,blue,cyan]),ptplt,scaling=constrained)
 >
 > # Projective Geometry Version
 > DistCirclez:=x^2+y^2-z^2;  #a Cone
 >
 (14)
 > pt1p:=[pt1[],1]; pt2p:=[pt2[],1]; pt3p:=[pt3[],1]; pt4p:=[pt4[],1]; pt5p:=[pt5[],1];
 (15)
 >
 >
 >
 > L12p:=(13*x)/12 + (5*y)/8 - (71*z)/96;#LnPeqns([pt1p,pt2p,[0,0,0]]);
 (16)
 > L13p:=(13*x)/12 + (5*y)/8 - (71*z)/96;#LnPeqns([pt1p,pt3p,[0,0,0]]);
 (17)
 > L23p:=(9*x)/28 - (7*y)/4 + (69*z)/56;#LnPeqns([pt2p,pt3p,[0,0,0]]);
 (18)
 > L35p:=(27*x)/14 + (7*y)/5 + (321*z)/140;#LnPeqns([pt3p,pt5p,[0,0,0]]);
 (19)
 > L04p:=3/5*x-4/5*y-1*z;
 (20)
 > ptpltp:=point([pt1p,pt2p,pt3p,pt4p,pt5p],symbol=solidsphere, symbolsize=8,color="green"): intp1:=intersectplot(DistCirclez,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,linestyle=solid):#unit circle at z=1 intp12p:=intersectplot(L12p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue): intp13p:=intersectplot(L13p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue): intp23p:=intersectplot(L23p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue): intp35p:=intersectplot(L35p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=blue): intp04p:=intersectplot(L04p,z=1,x=-2.5..2.5,y=-2.5..2.5,z=0..1,color=cyan):
 >
 > display(ptpltp,intp1,intp12p,intp13p,intp23p,intp35p,intp04p,scaling=constrained,caption="Projective Co-ords on plane z=1",axes=normal,axis[3]=[tickmarks=[1]])
 >

## Selecl Remove from a set...

Maple 2024

How do I get the susset that contains unknowns on the rhs of the elements?

 > restart
 >
 > # I need this subset {a=1/sqrt(2+A), b=6*sqrt(4+N),  d=5*H}
 >
 > C:={a=1/sqrt(2+A),b=6*sqrt(4+N) ,c=sqrt(7),d=5*H,,e=-12,f=-96}
 (1)
 > selectremove(has,indets(rhs~(C)),C)
 (2)
 > selectremove(has,lhs~(C)=indets(rhs~(C)),C)
 (3)