Question: Trying to typeset Dotproduct "&." on a plot

I need to produce some diagrams for the help pages of my package. I trying to typeset the dot product "." on a plot but keep getting a % symbol. I have tried without typesetting but makes no differance.

restart

 

 

Sdim:=proc(A,B,C,clr::string,S:=NULL)
    description"plots spread symbol";
    uses plots,plottools;
    local aa,bb,c,d,e,f,g,h,k,p1,v1,v2,vab,vac;
    vab:=Vector(B-A);
    vac:=Vector(C-A);
    aa:=(B-A)/5;
    bb:=(C-A)/5;
    p1:=plottools:-point([A,B,C],symbol=solidcircle);
    c:= plottools:-line(A+aa,A+bb);
    d:=plottools:-line(A,B);
    e:=plottools:-line(A,C);
    f:=plots:-textplot([op(1.1*(A+(aa+bb)/2)+[1.5,0]), typeset(S)]);   #print S
    g:=plots:-textplot([op(.9*A), typeset([x[1],y[1]])]);  #[x1,y1]
    h:=plots:-textplot([op(1.1*B), typeset([x[2],y[2]])]);  #x2,y2]
    k:=plots:-textplot([op(1.05*C), typeset([x[3],y[3]])]);  #x3,y3]
    v1:=plots:-textplot([op(A+(B-A)/2+[.2,-.2]), typeset(`#mover(mi("v"),mo("⇀"))`[a])]);   # vector symbol
    v2:=plots:-textplot([op(A+(C-A)/2+[-.2,.2]), typeset(`#mover(mi("v"),mo("⇀"))`[b])]);   #vector symbol
    display(p1,c,d,e,f,g,h,k,v1,v2,axes=none,scaling=constrained,caption="Spread between two vectors");    #place title under diagram
end proc

 

proc (A, B, C, clr::string, S := NULL) local aa, bb, c, d, e, f, g, h, k, p1, v1, v2, vab, vac; description "plots spread symbol"; vab := Vector(B-A); vac := Vector(C-A); aa := (1/5)*B-(1/5)*A; bb := (1/5)*C-(1/5)*A; p1 := plottools:-point([A, B, C], symbol = solidcircle); c := plottools:-line(A+aa, A+bb); d := plottools:-line(A, B); e := plottools:-line(A, C); f := plots:-textplot([op(1.1*(A+(1/2)*aa+(1/2)*bb)+[1.5, 0]), typeset(S)]); g := plots:-textplot([op(.9*A), typeset([x[1], y[1]])]); h := plots:-textplot([op(1.1*B), typeset([x[2], y[2]])]); k := plots:-textplot([op(1.05*C), typeset([x[3], y[3]])]); v1 := plots:-textplot([op((1/2)*A+(1/2)*B+[.2, -.2]), typeset(`#mover(mi("v"),mo("⇀"))`[a])]); v2 := plots:-textplot([op((1/2)*A+(1/2)*C+[-.2, .2]), typeset(`#mover(mi("v"),mo("⇀"))`[b])]); plots:-display(p1, c, d, e, f, g, h, k, v1, v2, axes = none, scaling = constrained, caption = "Spread between two vectors") end proc

(1)

Spr:=S=1-(`#mover(mi("v"),mo("⇀"))`[b-a]%.`#mover(mi("v"),mo("⇀"))`[b-a])^2/(`#mover(mi("v"),mo("⇀"))`[a]%.`#mover(mi("v"),mo("⇀"))`[a])/(`#mover(mi("v"),mo("⇀"))`[b]%.`#mover(mi("v"),mo("⇀"))`[b]);

S = 1-`%.`(`#mover(mi("v"),mo("⇀"))`[b-a], `#mover(mi("v"),mo("⇀"))`[b-a])^2/(`%.`(`#mover(mi("v"),mo("⇀"))`[a], `#mover(mi("v"),mo("⇀"))`[a])*`%.`(`#mover(mi("v"),mo("⇀"))`[b], `#mover(mi("v"),mo("⇀"))`[b]))

(2)

Sdim([1,2],[5,1],[4,7],"blue",Spr);

 

 

 

Download Q_2024-02-15_Help_Spread_diagram.mw

Please Wait...