1172 Reputation

12 years, 188 days

Has Select Quaestion...

Maple

I trying to simplify expressions for lines so no higher order terms. factor and op seperate out what I need but how do I select the one with the variables in this case x,y. I cant depent on this always been the last one returned from the op command.

 > restart
 >
 > vars=[x,y]
 (1)
 > k:=17
 (2)
 > expr:=-2*sqrt(118)*(((-4*x + y + 51/32)*sqrt(k) + (k*x)/4 - (51*y)/4 + 153/32)*sqrt(-4012 + 1003*sqrt(k)) + ((x + 4*y)*sqrt(k) - (85*x)/4 - (17*y)/4)*sqrt(4012 + 1003*sqrt(k)))*k^(1/4)/(17051*(-1 + sqrt(k)))
 (3)
 > indets(expr)
 (4)
 > factor(expr)
 (5)
 > op(factor(expr))
 (6)
 > select(has,vars, factor(expr))
 > select(has,vars, op(factor(expr)))

Extend/Truncate list of Colours to plot ...

Maple 2024

I need to automatically extend or truncate a colour list to suit number of points in plottools:-point plot.
extending the list the colour sequence could be repeated or if the is too awkard just add black.
I can't figure out how to select the list of colours to put into a new list to modify.

This will be inside a plotting procedure.

 > restart
 > with(ListTools)
 (1)
 > L:=[[1,2],[3,4],[-5,6],[-3,-2]]
 (2)
 > qty:=nops(L)
 (3)
 > styles:=[symbol=solidcircle,colour=[red,green,blue,orange],symbolsize=12]
 (4)
 >
 > plots:-display(plottools:-point(L,styles[]))
 > #Need to extend or truncate the list of colours to match the number of points #styles can be copied to styles 1,2 etc #the extended list would be a repeatition of the colour sequence given #would need to look for color or colour; has(styles,colour); #how to select colour our into a seperate list?
 (5)
 > #too few point for the colours; L1:=[[1,2],[3,4],[-5,6]]
 (6)
 > plots:-display(plottools:-point(L1,styles[]))
 > #too many point for the colours; L2:=[[1,2],[3,4],[-5,6],[-3,-2],[6-1],[0,1]]
 (7)
 > plots:-display(plottools:-point(L2,styles[]))

Textplot3d parallel to line question...

Maple 2024

If there any way to make text  parallel to a line in textplot3d.

```display(line([1,2,3],[4,5,-2],linestyle=longdash),
point([2.5,3.5,0.5]),
textplot3d([2.5,3.5,0.5,"not aligned"]))
```

warning about alias when run worksheet...

Maple 2024

This problem began about 3 nights ago.

When I load the subpackage UHG to RationalTrigonometry no warning.

When I rerun the worksheet warnings appear. If I put in arestart and reload the packages no warning. The problem only occurs with the sub packageUHG. The RationalTrigonometry package also has a few aliases.

Screen shot of one rerun  then added restart.

How to test for matrix type/size?...

Maple 2024

I am trying to check if the inputs are a pair of row or column matrices. How should I do that? I have tried type but no success.

 > restart
 >
 > TestDim:=proc(p1::{Matrix(1,3),Matrix(3,1)},p2::{Matrix(1,3),Matrix(3,1)},prnt::boolean:=Prntmsg) description "Midpoints, Bilines"; uses RationalTrigonometry; local x1, y1, z1, x2, y2, z2,m1,m2,xpsn , ypsn,zpsn ; if [Dimension(p1)]=[1,3] and [Dimension(p2)]=[1,3] then         m1:= Vector[row](3);       m2:= Vector[row](3);       print([1,3]);   elif [Dimension(p1)]=[3,1]and [Dimension(p2)]=[3,1] then       m1:= Vector[column](3);       m2:= Vector[column](3);        print([3,1]);  else       ERROR(p1,p2, `must both be row or column matrices`); end if; end proc
 (1)
 > f:=<>; g:=<>
 (2)
 > TestDim(f,g)
 >