Ronan

1267 Reputation

14 Badges

12 years, 278 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I setup my package to display the a message when it is loaded. It is quiet convienent but I don't need it all the time. Obviously I can "#" in the code to hide it premanently. I was wondering if there is away to optionally turn it off/on. Something along the lines.

with(RationalTrigonometry,false) or with(RationalTrigonometry)[false]....

Or put something in the .ini flie to set the default behaviour.

restart:with(RationalTrigonometry):
 "Default global settings:-

     GeomClr = "Blue",

      Prntmsg = true,

       Prjpsn = 3 can be set to 1,

      Normalgpt = 1 or set to 0, 

    Metric is a 3 x3 symmetric matrix defaults to the Identity 

    matrix "


 

Windows 10 64bit

If I double click on a  file to open it from explorer  i.e. launch Maple, it is 50/50 whether Maple hangs on opening the file and I have to kill it in the Task Manager. This only happens the 1st time I try to open the file. Subsequent clicks on it will open it. If Maple is already open the problem does not happen.  The problem willl also be there after the PC is restarted. Has anyone else noticed this?

I have used "colour" as my spelling on optional inputs to procedures in my package.  How can I also handle the alternative spelling "color"?  
 

restart

 

coltest:=proc(c)
  if c="b" then return 1
   elif c="r" then return 2
   elif c="g" then return 3
  end if;
end proc:

 

foo:=proc(a,{colour:="b"})
local COL;
   COL:=coltest(colour);
if COL=1 then return a
  elif COL=2 then return a^2
  elif COL=3 then return a^3
  else error `wrong colour`;
end if ;
end proc:

 

foo(3,colour="r")

9

(1)

foo(2,colour="p")

Error, (in foo) wrong colour

 
 

 

Download 2024-03-21_Q_colour_or_color.mw

I am trying to tidy up cases where a proc returns multiple values. Have being trying Tabulate. I can get it to work when called after the results are returned. I would the procedure to do this but  keep acces to the name(s) assigned to the returned values.

A,B,C:= proc(...)  .....  return a, b, c    end proc. 

So basically display a tabulated of a, b, c.
 

restart

 

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
#return [columns,[qqf,q13,q24]];


if prnt then
print(cat(" ",columns[1],"    ",columns[2],"     ",columns[3])) ;
end if;
return qqf ,q13,q24


 end proc:

q12:=1/2:q23:=9/10:q34:=25/26:q41:=9/130: #Cyclic quadrilateral
 AA:=QQFProj(q12,q23,q34,q41,true);


AA[1];
AA[2];
AA[3]

" QQFproj    Q13proj     Q24proj"

 

9801/2856100 = 9801/2856100, 4/5, 16/65

 

9801/2856100 = 9801/2856100

 

4/5

 

16/65

(1)

# Can the below be built into the proc to nicely didplay the results but maintain access to the results as shown when prnt=true.

columns:=[QQFproj,Q13proj,Q24proj]:
BB:=QQFProj(q12,q23,q34,q41,false):
DocumentTools:-Tabulate([columns,[BB]],width=55):#could do with a variable width depending on length of output epression.

BB[1];
BB[2];
BB[3]

9801/2856100 = 9801/2856100

 

4/5

 

16/65

(2)

dspformat:=(BB,columns)->DocumentTools:-Tabulate([columns,[BB]],width=75);

proc (BB, columns) options operator, arrow; DocumentTools:-Tabulate([columns, [BB]], width = 75) end proc

(3)

CC:=dspformat(BB,columns):#layout not as expected

CC[1] ; #  just gives  letters from Tabulate

"T"

(4)

 


 

Download 2024-03-18_Q_Format_Returned_Results_into_a_Table..mw

 I am writing help pages for a package. The inital Overview should be at the top of the listing like in other Maple help directories. 

How to I do this? Mine is listing purely alphabetically.
 

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"])

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

NULL

NULL

NULL       

NULL


 

Download Help_Edit_to_Database_2023.mw

First 6 7 8 9 10 11 12 Last Page 8 of 33