> |
#with( RationalTrigonometry)
|
> |
# 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:=[]})
|
> |
Q:=[Q_12,shift=0.6,align =[below,right]]
|
![[Q_12, shift = .6, align = [below, right]]](/view.aspx?sf=239054_question/deddbf91d2006263af231cf0a88ae1b5.gif)
|
(1) |

|
(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;
|

|
(3) |
|