Ronan

1022 Reputation

14 Badges

13 years, 155 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are replies submitted by Ronan

@dharr  I appear to have the setup working in principal. I created seperate worksheets. One for the Main Package and one for the Sub Package. Both attached.  I have hilighted the differences in both in red. Then I copied both help files across to the correct location. They now list correctly in Help. 

 

New_RT_Edit_Dadabase_2024.mw

New_UHG_Edit_Dadabase_2024.mw

@dharr   I have made some progress. I would like to structure the TOC so that the main package commands are directly under the Rational Trigonometry heading i.e. TOCtop. Then I have two sub packages UHG and RT Projective. I would like these to be under TOCsub1 and TOCsub2 rsspectivels.  Have tried several modifications to do with std2 & children () but no luck yet.

What would you suggest?

Edit:- I have being wondering about structuring the help files for the sub packages is sub folders and doing a seperate database document for each.

NULL

with(HelpTools)

[Database, TableOfContents, Worksheet]

(1)

currentdir()

"D:\User Account Ronan\Documents\MAPLE\Rational Trigonometry"

(2)

 

NULL

NULL

HelpTools[Database][Create]("C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help")

"C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help"

(3)

HelpTools[Database][Add]("C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help")

["C:\Program Files\Maple 2024\lib\maple.help", "C:\Program Files\Maple 2024\lib\maple_ja.help", "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib\CodeBuilder.help", "C:\Users\Ronan\maple\toolbox\DirectSearch\lib\DirectSearch.help", "C:\Users\Ronan\maple\toolbox\OEIS\lib\OEIS.help", "C:\Users\Ronan\maple\toolbox\UTF8\lib\UTF8.help"]

(4)

HelpTools[Database][GetActive]()

["C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", "C:\Program Files\Maple 2024\lib\maple.help", "C:\Program Files\Maple 2024\lib\maple_ja.help", "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib\CodeBuilder.help", "C:\Users\Ronan\maple\toolbox\DirectSearch\lib\DirectSearch.help", "C:\Users\Ronan\maple\toolbox\OEIS\lib\OEIS.help", "C:\Users\Ronan\maple\toolbox\UTF8\lib\UTF8.help", "C:\Users\Ronan\maple\toolbox\personal\lib\RationalTrigonometry.help"]

(5)

NULL

makehelp("RationalTrigonometry", "Rational Trigonometry Overiew Help.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["RatTrig", "Rat Trig", "RT", "R T"], browser = ["Rational Trigonometry", " Overview"])

["C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", "C:\Program Files\Maple 2024\lib\maple.help", "C:\Program Files\Maple 2024\lib\maple_ja.help", "C:\Users\Ronan\maple\toolbox\CodeBuilder\lib\CodeBuilder.help", "C:\Users\Ronan\maple\toolbox\DirectSearch\lib\DirectSearch.help", "C:\Users\Ronan\maple\toolbox\OEIS\lib\OEIS.help", "C:\Users\Ronan\maple\toolbox\UTF8\lib\UTF8.help", "C:\Users\Ronan\maple\toolbox\personal\lib\RationalTrigonometry.help"]

(6)

makehelp("RationalTrigonometry,Quadrance", "Help Quadrance.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", browser = ["Rational Trigonometry", "Quadrance"])

makehelp("RationalTrigonometry,Cross Law", "Help Cross Law.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", browser = ["Rational Trigonometry", "CrossLaw"])

makehelp("RationalTrigonometry,Spread", "Help Spread.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["RT Spread", "R T Spread"], browser = ["Rational Trigonometry", "Spread"])

makehelp("RationalTrigonometry,Spread Law", "Help Spread Law.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["RT Spread Law", "Spread Law Quadrea"], browser = ["Rational Trigonometry", "Spread Law"])

makehelp("RationalTrigonometry,TQF", "Help Triple Quad Formula.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["Triple Quad Formula", "TQF"], browser = ["Rational Trigonometry", "Triple Quad Formula"])

makehelp("RationalTrigonometry,TSF", "Help Triple Spread Formula.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["Triple Spread Formula", "TSF"], browser = ["Rational Trigonometry", "Triple Spread Formula"])

makehelp("RationalTrigonometry,QQF", "Help Quadruple Quad Formula.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["Quadruple Quad Formula", "QQF"], browser = ["Rational Trigonometry", "Quadruple Quad Formula"])

makehelp("RationalTrigonometry,QSF", "Help Quadruple Spread Formula.mw", "C:/Users/Ronan/Maple/toolbox/personal/lib/RationalTrigonometry.help", aliases = ["Quadruple Spread Formula", "QSF"], browser = ["Rational Trigonometry", "Quadruple Spread Formula"])

NULL

Download Help_Edit_to_Database_2023.mw

@C_R I removed Java because I don't really need it. That has definately made Explorer a lot snappier. Don't get the white page for 5-10 secs.

Double clicking on a Maple file to open is better, but some do just hang Maple with the white window. I left it for 10 mins to see.

@C_R Explorer has also strated handing for 10 seecs or so. Java is a good clue here. It installed a Jave viewer (I think) less than a month ago when I was looking ast how to export 3D plots for 3D pdfs. Shall remove that tonight when I get home and let you know.

 

Edit:- Maple always starts from the task bar. Rarely use the start menu for it

@acer Oh good. Nothing complex then. I had tried {colour,color}. Didn't work. 

@acer  "...a double printing of qqf,q13,q24".  I meant that it would tabulate the values and then also return them seperately onto the screen,

@acer  I am most supprised that 

DocumentTools:-Tabulate([columns,[qqf,q13,q24]],'width'=55);
  return qqf,q13,q24

don't produce a double printing of qqf,q13,q24.  Because that is exactly what I didn't try.

I have altered the proc so Tabulate is inside the if statement.

QQFProj := proc(q12::algebraic, q23::algebraic,
                q34::algebraic, q14::algebraic,
                {columns:=[QQFproj,Q13proj,Q24proj]},  prnt::boolean:=true) 
  description "Projective quadruple quad formula and intermediate 13 and 24 quads. Useful for cyclic quadrilaterals";
  local qqf,q13,q24, sub1,sub2,sub3, R;
  uses  DT = DocumentTools;
  sub1:= (q12 + q23 + q34 + q14)^2 - 2*(q12^2 + q23^2 + q34^2 + q14^2) ;
  sub2:=-4*(q12*q23*q34+q12*q23*q14+q12*q34*q14+q23*q34*q14)+8*q12*q23*q34*q14;
  sub3:=64*q12*q23*q34*q14*(1-q12)*(1-q23)*(1-q34)*(1-q14);
  qqf:=(sub1+sub2)^2=sub3;
  q13:=((q12-q23)^2-(q34-q14)^2)/(2*(q12+q23-q34-q14-2*q12*q23+2*q34*q14));#check this
  q24:=((q23-q34)^2-(q12-q14)^2)/(2*(q23+q34-q12-q14-2*q23*q34+2*q12*q14));#check this
  if prnt then
  DT:-Tabulate([columns,[qqf,q13,q24]],'width'=55);
  return qqf,q13,q24
  end if;
  return qqf,q13,q24
end proc:

 

@dharr I have just returned to this. Thank you for the work you put into finding out what can be done. I too found that Maple would only export 3D objects not lines points or text. I don't know whether this is a file type restriction or a Maple export limitation. Maybe an enhancment request should be submitted for this type of functionality.
 

@dharr Thank you. I will spend the next night or so studying that.

@WD0HHU 

simplify(res) assuming `real`

 

@acer The timing differences are striking. I need to do more of the tests on my own code.

@acer That is a great answer. I tested it and it so far is working in the package. 

In the code below why does :-align not have the unevaluation quotes,

                                             symbol has nothing

                                            'color'  doesn't have  :-  

Qdim := proc(P1, P2, {Q:=[ NULL,:-align={':-left'}]},
                     {vec1::list:=[NULL,:-align={':-below',':-right'}]},
                     {scale::{list,numeric}:=1},
                     {leader::{-1,0,1}:= 1},
                     {dimoffset::{1,2,3,4,5,6}:=1},
                     {point::list:=['color' = ':-blue', symbol = ':-solidcircle', 'symbolsize' = 8]},
                     {line::list:=['thickness'=3]},
                     {plopts::list:=[]})

While I am asking al lot of keywords in 1d input are enclosed in the single back quotes ` ` but what do they actually do? Sometimes it seems to make no differance whether they are used or not. I know the are also used in prefix notation too.  

@acer Ok so what I have here with the procedure is outside of the package. So that may be affecting things.

I have altered the parameter names annotated in in the worksheet. Now `clr` is changed to `colour` that causes a clash. `Colour` works. `points` changed to `Point` not working. I can solve the problem. I was just trying to come up with sensible names. I was concerned about my capatilised names conflicting with other packages also I wasnted to keep them lower case if possible. @Carl Love indicated that this would not be a problem inside a package.

I will probably settle on names such as pointdata, linedata, message::boolean =true instead of prnt="y" 

2024-03-09_Example_parm_names_changed.mw

@acer Basically I don't know using nicer, parameter names suck as line, point, and colour, and print (I am sure print clashes)will clash.  Hopefully this will demonstrate sufficiently.  


 

restart

 

Prntmsg:="y"; Geomclr:="Blue";

"y"

 

"Blue"

(1)

Qdim := proc(P1, P2, {Q:=[ NULL,align={left}]},
                     {vec1::list:=[NULL,align={below,right}]},
                     {scl::{list,numeric}:=1},
                     {leader::{-1,0,1}:= 1},
                     {dimofset::{1,2,3,4,5,6}:=1},
                     {points::list:=[color = blue, symbol = solidcircle, symbolsize = 8]},
                     {linetype::list:=[thickness=3]},
                     {clr::`string`:=Geomclr},
                     {prnt:=Prntmsg})
description " plots Quadrance symbol and value (Q)";
uses plottools; # RationalTrigonometry;
local a,  f,g,h,v1,delta,mp, BoxQ,Qsymbol,pt1,pt2,pt3,pt4,Scl,ptxtp1,ptxtp2,txtplt1,txtplt2,plttyp,thk,l12,pts12;

if P1[1]::{list, Vector[row]} then
   pt1:=`if`(P1[1]::Vector[row],convert(P1[1],list),P1[1]);
   plttyp:=`if`(nops(pt1)=3,3,2); # print(pt1,plttyp);
   ptxtp1:=[op(pt1),op(P1[2..-1])];
   txtplt1:=true;  
 else
   pt1:=`if`(P1::Vector[row],convert(P1,list),P1);#print(pt1);
   plttyp:=nops(pt1);
   txtplt1:=false;
end if;    

if P2[1]::{list, Vector[row]} then
   pt2:=`if`(P2[1]::Vector[row],convert(P2[1],list),P2[1]);#print(pt2);
   if plttyp<>nops(pt2) then error `different dimension in inputs`end if;
   ptxtp2:=[op(pt2),op(P2[2..-1])];
   txtplt2:=true;
 else
   pt2:=`if`(P2::Vector[row],convert(P2,list),P2);#print(pt2);
   if plttyp<>nops(pt2) then error `different dimension in inputs`end if;
   txtplt2:=false;
end if;

#if scl::numeric then
    Scl:=scl;
 #else
  # pt3:=`if`(scl[1]::Vector[row],convert(scl[1],list),scl[1]);
   #pt4:=`if`(scl[2]::Vector[row],convert(scl[2],list),scl[2]);
    #if plttyp = 2 then
     #  Scl:=evalf(sqrt(Quadrance(pt3,pt4,"b","n")/Quadrance(pt1,pt2,"b","n")));
     #else
      # Scl:=evalf(sqrt(Quadrance(pt3,pt4,"n")/Quadrance(pt1,pt2,"n")));
   # end if;
#end if;
if plttyp =2 then
     a :=Scl* dimofset*0.1*leader*[-pt2[2]+pt1[2], pt2[1]-pt1[1]]; #dimension leader lines
  else
     a :=Scl* dimofset*0.1*leader*[-pt2[2]+pt1[2], pt2[1]-pt1[1],pt2[3]-pt1[3]]; #dimension leader lines
end if;
delta:=Scl*(pt2-pt1);
mp:=(1-1/2)*pt1+1/2*pt2;  #midpoint of line
#print(Scl,a,delta,mp);
if plttyp = 2 then
    BoxQ:=[[a[1]+mp[1]+.05*delta[1]-.01*delta[2],a[2]+mp[2]+.05*delta[2]+.01*delta[1]],
           [a[1]+mp[1]-.05*delta[1]-.01*delta[2],a[2]+mp[2]-.05*delta[2]+.01*delta[1]],
           [a[1]+mp[1]-.05*delta[1]+.01*delta[2],a[2]+mp[2]-.05*delta[2]-.01*delta[1]],
           [a[1]+mp[1]+.05*delta[1]+.01*delta[2],a[2]+mp[2]+.05*delta[2]-.01*delta[1]]];
 else
    BoxQ:=[[a[1]+mp[1]+.05*delta[1]-.01*delta[2],a[2]+mp[2]+.05*delta[2]+.01*delta[1],a[3]+mp[3]+.05*delta[3]],
           [a[1]+mp[1]-.05*delta[1]-.01*delta[2],a[2]+mp[2]-.05*delta[2]+.01*delta[1],a[3]+mp[3]-.05*delta[3]],
           [a[1]+mp[1]-.05*delta[1]+.01*delta[2],a[2]+mp[2]-.05*delta[2]-.01*delta[1],a[3]+mp[3]-.05*delta[3]],
           [a[1]+mp[1]+.05*delta[1]+.01*delta[2],a[2]+mp[2]+.05*delta[2]-.01*delta[1],a[3]+mp[3]+.05*delta[3]]];
end if;

if leader<>0  then
   thk:=thickness=0
 elif linetype<>[] then
   thk:=linetype[op(ListTools:-Search(op(select(has,linetype,thickness)),linetype))];
 else
   thk:=thickness=0;
end if;

Qsymbol:= [line(pt1,pt1+a,thickness=0,_rest),
           line(pt1+a,mp-.05*delta+a,thk,_rest),
           line(op([BoxQ[1],BoxQ[2]]),thickness=0,_rest),
           line(op([BoxQ[2],BoxQ[3]]),thickness=0,_rest),
           line(op([BoxQ[3],BoxQ[4]]),thickness=0,_rest),
           line(op([BoxQ[4],BoxQ[1]]),thickness=0,_rest),
           line(pt2+a,mp+.05*delta+a,thk,_rest),
           line(pt2,pt2+a,thickness=0,_rest)];
    
if points<>[]then           
pts12:=point([pt1,pt2],op(points));  #end points
else
pts12:=NULL;
end if;
if linetype<>[] then
l12:=line(pt1,pt2,op(linetype));
  else
  l12:=NULL;
  end if;
if plttyp = 2 then
    f := plots:-textplot([op((pt1+pt2)/2+1*(a)),op(Q)]);  #Quadrance text
   if txtplt1 then
      g := plots:-textplot( ptxtp1);
    else
      g:=NULL;
   end if;
   if txtplt2 then
      h := plots:-textplot( ptxtp2);
    else
     h:= NULL;
   end if;
    v1:=plots:-textplot([op((pt1+pt2)/2), op(vec1)]);#`#mover(mi("v"),mo("&rharu;"))`[1,2]   {below,right}
 else

   f := plots:-textplot3d([op((pt1+pt2)/2+1*(a)),op(Q)]);
   if txtplt1 then
         g := plots:-textplot3d( ptxtp1);
      else
         g:=NULL;
   end if;
   if txtplt2 then
         h := plots:-textplot3d( ptxtp2);
      else
         h:=NULL;
   end if;
    v1:=plots:-textplot3d([op(pt1+pt2)/2,op(vec1)]);#`#mover(mi("v"),mo("&rharu;"))`[1,2]   {below,right}
end if;
#print("pltyp" , plttyp)  ;
if prnt="y" then print(cat("Quadrance symbols  ",clr,"  geometry")); end if;
if leader = 0 then    
    plots:-display(pts12,f,g,h,Qsymbol,axes=none,scaling=constrained);
 else       
         plots:-display(pts12,l12,f,g,h,Qsymbol,axes=none,scaling=constrained);     
end if;
end proc:

 

 

P1:=[2,3,6]:
P2:=[1,5,7]:
P3:=P1+1/3*(P2-P1)

[5/3, 11/3, 19/3]

(2)

plt1:=Qdim([P1,typeset("P1=",P1),align=below],[P2,P2,align=right ],dimofset=2,Q=["Q12\n",align =above],colour=black); use of _rest, colour=black

 

"Quadrance symbols  Blue  geometry"

 

 

Error, missing operator or `;`

 

plt2:=Qdim([P1,typeset("P1=",P1),align=below],[P3,P3,align=right ],scl=2,Q=["Q13\n",align =above],prnt="n") ; #scl affects the linine up of dimesion lines prnt="n" no message displayed

 

plt3:=Qdim(P3,P2,scl=1,Q=["Q23\n",align =above],points=[],linetype=[],clr="RED"); #doesn't plot points and line. shows use of `clr`

 

 

"Quadrance symbols  RED  geometry"

 

 

plots:-display(plt1,plt2,plt3)

 

P5:=[1,2]:P6:=[-1,4]:

Qdim([P5,"P5   ",align={below,left}],[P6,"   P6",align={right}], Q=[typeset("\nQ[5,6]"),align={below,left}],points=[symbolsize=18])

"Quadrance symbols  Blue  geometry"

 

 

Qdim([P5,"P5   ",align={below,left}],[P6,"   P6",align={right}], leader=0,Q=[typeset("\nQ[5,6]"),align={below,left}],points=[symbolsize=18])

"Quadrance symbols  Blue  geometry"

 

 

 


 

Download 2024-03-09_Example_parm_names.mw

@acer  Oh yes that is nicer using infix.  Really sometimes I miss the obvious. I have being using plottools:-line for the past two weeks. 

1 2 3 4 5 6 7 Last Page 1 of 24