Ronan

1267 Reputation

14 Badges

12 years, 276 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

I am trying to improve the positioning of the gammas in the diagram (at bottom) as they are too close to the points and lines. gamma1 and gamma2 have been assigned values. This best I could come up with is shown below.

restart;

with(plots):with(plottools):

with(Typesetting):

`gamma2`:=<3|5|2>

Vector[row](3, {(1) = 3, (2) = 5, (3) = 2})

(1)

Pgamma2:=[3/2,5/2]

[3/2, 5/2]

(2)

display(point(Pbeta2,symbol=solidcircle,symbolsize=14),textplot([Pgamma2[],Typeset((`gamma2` )),align={above}]))

 

 

 

Download 2024-07-10_Typeset_gamma.mw

I have a command called Dual in a SubPackage. RationalTrigonometry:-UHG:-Dual(..). I cannot get the hyperlink from the overview page to work.i.e RationalTrigonometry,UHG,Dual If I use Dual on its own it finds another Maple command to do with boolean logic. What syntax should I use here? I have used RationalTrigonometry,Spread without a problem to avoid another Maple command.

 

I have had this a few times this week since updating to 2024.1 on Windows 10.

I get sudden freezes in a worksheet. The !!! button greys out. The ! button is ok, so the worksheet can be run by using ctrl A and click !

Has anyone else experienced this?

I have used alias for various reasons inside a pagkage. It is useful for coupling old command names to modern ones.

I am trying now to get this to work inside a sub package but no success. Can this be done?

restart

 

pkg:=module()
option package;
export   Sqr, UHG;
alias(XX=Sqr);
#alias(eparm=CirclePramUHG);
Sqr:=proc(x)
   return x^2;
end proc;

 UHG:=module()
          option package;
         
          export
               CircleParmUHG;

alias(eparm=CirclePramUHG);

     CircleParmUHG := proc(T::algebraic, U::algebraic)
       local t, u, P, cp;
         #  P := point;
             t := T*denom(T)*denom(U);
             u := U*denom(T)*denom(U);
         # if P <> NullPoint then
         #   P := 'NullLine';
         #end if;
        if t::numeric and u::numeric and t<>0 and u<>0 then
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>/gcd(gcd(u^2 - t^2, 2*u*t), u^2 + t^2);
          else
             cp:=  <u^2 - t^2| 2*u*t| u^2 + t^2>;
        end if;
        return cp
      end proc;
    end module;
end module;

_m2044017012448

(1)

with(pkg)

[Sqr, UHG]

(2)

Sqr(4)

16

(3)

UHG:-CircleParmUHG(t,u)

[`?`]

(4)

UHG:-eparm(t,u)

Error, eparm is not a command in the pkg:-UHG package

 

with(UHG)

[CircleParmUHG]

(5)

CircleParmUHG(2,7)

Vector[row]([45, 28, 53])

(6)

eparm(2,7)

eparm(2, 7)

(7)

 

XX(3)

9

(8)
 

 

Download 2024-06-29_use_alias_in_a_Sub_Package.mw

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

 

false

(1)

foo(6,S=[1]);

true

(2)

foo(6,S=[typeset("cat=",H/H),align={above,left},color=green]); #good

true

(3)

foo(6,S=[typeset("cat=",H),align={above,left}])

false

(4)

foo(6,S=[typeset("cat=",1+H)],align={above,left},color=green);#want to fix this

 

 

true

(5)

foo(6,S=[typeset("cat=",`1+H`)]); #work around

false

(6)

foo(6,S=[typeset("cat=",`B/(H+1)`)]); #work around

false

(7)

foo(6,S=[typeset("cat=",`B/(H+1)`,"  height =",1)]); #correct

true

(8)

foo(6,S=[typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)]); #correct

true

(9)

op(typeset("cat=",B/(H+1)));# this would be false

 

"cat=", B/(1+H)

(10)

op(typeset("cat=",H^2/((2*H-H)*H),"  height =",`B/(H+1)`)) ;  # this would be true

 

 

"cat=", 1, "  height =", `B/(H+1)`

(11)
 

 

Download 2024-06-27_Q_check_inside_typeset.mw

2 3 4 5 6 7 8 Last Page 4 of 33