Ronan

1311 Reputation

14 Badges

12 years, 312 days
East Grinstead, United Kingdom

MaplePrimes Activity


These are questions asked by Ronan

What is the relationship between font size and screen pixels on plots? My screen are 2560 x1440 and 1920 x1200. Is for exanple size 12 font 12 pixels high?

Also when a diplay plot is say 800 x 600 pixels in size does the plot  does it use the max horizontal or vertical number of pixels? I know it may not fill the plot area in both directions. Or are some pixels trimmed of around the sides. Is it that the bounding box is the 800 x 600? I know when a caption is added the plot area is reduced in size vertically. 

I have angled some test to be parallel to the slope of a line. It tuns out that the text is only parallel if scaling = constrained is used. That is not necasserily pratical for many plots. In prcttice I have a nice proedure for this. Is there any way to pickup the plot x-y scaling factor that maple decides on so I could built that into the procedure. I have manually rescaled her to demonstrate.

mmm...I see the website viewer does not rotate the text.

restart

with(plots):

P1:=[1,2]:P2:=[5/2,3]:

vec:=P2-P1

[3/2, 1]

(1)

ang:=arctan(vec[2],vec[1])

arctan(2/3)

(2)

plt1:=textplot([((P1+P2+[.2,.2])/2)[],"parallel piece of text",rotation=ang]):

plt2:=plottools:-line(P1,P2):

display(plt1,plt2)

 

display(plt1,plt2,scaling=constrained)

 

#scaling factor looks to be 1.5 i.e.delta(x)/delta(y) (2.5-1)/{3/2)

ang1:=arctan(1.5*vec[2],vec[1])

.7853981634

(3)

plt3:=textplot([((P1+P2+[.2,.2])/2)[],"parallel piece of text",rotation=ang1]):

display(plt3,plt2)

 
 

 

Download 2024-10-15_text_not_always_parallel.mw

What on earth am I doing wrong here? I am trying to check if two vectors are equal for parallelism.Yes, thinking about it I could use CrossProduct but that is the same problem because I would be checking if that new vector =<0,0,0>

l1:=<a,b,c>:l2:=<a,b,c>:
if l1 = l2 then 
print("Equal Vectors");
end if;

I have and input parameter to a procedure called shift:=05. It sets the position of test between to points.

this particular procedure has two potential sets of text one in Q and the other in vec.
Can Q and vec have the own individual values for shift?

I have shown the input to the procedure and what it outputs. The procedure itself to too long and akward to the post.

Also given is the input definiton of the procedure and how I could possibly find a shift in a list.

 

restart

#with( RationalTrigonometry)

P1:=[-1,3]:P2:=[4,5]:

# shift operates as such mp:=P1+shift*(P2-P1). It's default value 0.5 It moves
#   the text along between P1 and P2
# shift and shift are optional inputs to move individual test pieces.
#If Q contains shift then use it else use shift
  qp:=P1+shift*(P2-P1) or qp:=P1+shift*(P2-P1)
#Similarily for vec

Qdim([P1,typeset("P1=",P1),align=[left],colour=red] ,
     [P2,typeset("P2=",P2),align=[right],colour=purple] ,
      Q=[Q_12,align =[below,right],shift=0.6] ,
      point=[symbolsize=12,symbol=solidcircle,colour=blue,shift=0.4] ,
      vec=[typeset("v[12]=",P2-P1),align=[below,right],shift=0.1],
      shift=0.7):  

#The definition input of the procedure is

 

#proc(P1, P2,
#    {Q:=[ NULL,:-align={':-left'}]},
#        {corp::{"cart","proj"}:="cart"},
#        {shift:=0.5},
#        {vec::list:=[]},
#        {scale::{list,integer}:=1},
#        {leader::{-1,0,1}:= 1},
#        {dimoffset::{1/6,1/5,1/4,3/4,2/3,1/2,1/3,1,3/2,2,3,4,5,6}:=1},
#        {point::list:=['color' = ':-blue', symbol = ':-solidcircle', 'symbolsize' = 8]},
#        {line::list:=['thickness'=3]},
#        {plopts::list:=[]})

restart

Q:=[Q_12,shift=0.6,align =[below,right]]  
      
      

 

[Q_12, shift = .6, align = [below, right]]

(1)

nops(Q)

3

(2)

for i to nops(Q) do
 if has([op(Q[i])],`shift`) then
 qp:=rhs(Q[i]);
 print(i,qp);
 break;
end if;
end do;

2, .6

(3)

 


 

Download 2024-09-18_Select_name_and_Value_from_List.mw

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]

vars = [x, y]

(1)

k:=17

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

-2*118^(1/2)*(((-4*x+y+51/32)*17^(1/2)+(17/4)*x-(51/4)*y+153/32)*(-4012+1003*17^(1/2))^(1/2)+((x+4*y)*17^(1/2)-(85/4)*x-(17/4)*y)*(4012+1003*17^(1/2))^(1/2))*17^(1/4)/(-17051+17051*17^(1/2))

(3)

indets(expr)

{x, y}

(4)

factor(expr)

(1/64192)*(-4012+1003*17^(1/2))^(1/2)*118^(1/2)*17^(1/4)*(17^(1/2)+5)*(40*x-24*y-3)

(5)

op(factor(expr))

1/64192, (-4012+1003*17^(1/2))^(1/2), 118^(1/2), 17^(1/4), 17^(1/2)+5, 40*x-24*y-3

(6)

select(has,vars, factor(expr))

select(has,vars, op(factor(expr)))

Error, invalid input: has expects 2 arguments, but received 7

 
 

 

Download 2024-09-11_Has_Select_Question.mw

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