code for diagram
edited version of code for exercise in chapter 12 homework
>
circarr:=proc(center,start, angle,text,textsize,textoffset,colr)
local arc,dir, HEAD, V1,V2,V3,v1,v2,v3,arccenter, txt,tmp,rad,shift,head:
tmp:=evalf(start-center):
rad:=sqrt(tmp[1]^2+tmp[2]^2):
shift:=argument(tmp[1]+tmp[2]*I):
if evalf(shift) < 0 then shift:=shift+2*Pi: fi:
arc:=plot({[start],[center],[center[1]+rad*cos(shift+t),
center[2]+rad*sin(shift+t),t=0..angle]},thickness=3,
color=colr):dir:=.05*rad*(-sin(angle+shift)+
I*cos(angle+shift)):
HEAD:=rad*[cos(angle+shift),sin(angle+shift)]+center:
if evalf(angle)<0 then dir:=-dir fi:
dir:=evalc(dir):
v1:=evalc(dir*(I-1)):v2:=evalc(dir*(-I-1)):v3:=0:
V1:=2*[Re(v1),Im(v1)]:
V2:=2*[Re(v2),Im(v2)]:
V3:=2*[Re(v3),Im(v3)]:
arccenter:=center+(rad/2)*[cos(angle/2+shift),
sin(angle/2+shift)]:
txt:=plots[textplot]([arccenter[1]+textoffset,
arccenter[2],text],font=[TIMES,BOLD,textsize]):
head:=plots[polygonplot]([V1+HEAD,V2+HEAD,V3+HEAD],
color=colr)
plots[display]({arc,head,txt},scaling=constrained):
end:
>
AA:=[-6,2]:BB:=[-5,0]:CC:=[5,0]: DD:=[6,2]:
front:=[AA,BB,CC,DD]:
top:=[AA,DD,DD+[10,4],AA+[10,4]]:
leftside:=[CC,CC+[10,4], DD+[10,4], DD]:
hidn:=plot({[BB,BB+[10,4]],
[BB+[10,4],CC+[10,4]],[BB+[10,4],AA+[10,4]]},
color=black,linestyle=3,thickness=2):
nothidn:=plots[polygonplot]({front,top,leftside},
style=line,color=black,thickness=2):
txt:=plots[textplot]({[12,5,` `],[0,-.7,`14" `],
[-6.7,.7,`4"`],[10,1.25,`50`]},font=[TIMES,BOLD,16]):
vertdotlines:=plot({[[5,0],[5,1.8]],[[-5,0],[-5,1.8]]},
linestyle=3,thickness=3):
betaa:=circarr([-5,0],[-5,1.5], Pi/7,` `,14, .5,blue):
betab:=circarr([5,0],[5,1.5], -Pi/7,` `,14, .5,blue):
face:=plots[polygonplot]([AA,BB,CC,DD]):
txt2:=plots[textplot]({[12,5,` `],[0,-.7,`14" `],
[-6.7,.7,`4"`],[6.7,.7,`4"`]},font=[TIMES,BOLD,16]):
txt3:=plots[textplot]([0,1.5,`indicated angles are both theta`],font=[TIMES,BOLD,12]):
FACE:=plots[display]({betab,betaa,vertdotlines,face,txt2,
txt3},scaling=constrained,axes=none,view=[-7..7,-1..3]):
FACE;plots[display]({betab,betaa,vertdotlines,hidn,
nothidn,txt},scaling=constrained,axes=none);