from piscript.PiModule import *

import math

pink=[0.8,0,0]
grey=0.5

init("bigarrow", 560, 120)

beginpage()
gsave()
center()
scale(27)
translate(-8, 0)
sw = 1.6
hw = 3.6
ds = 0.2

gsave()
setdash([ds,ds], 0)
newpath()
moveto(-2,0.5*sw)
lineto(-1,0.5*sw)
moveto(-2,-0.5*sw)
lineto(-1,-0.5*sw)
stroke(pink)
grestore()

gsave()
setdash([ds,ds], 0)
newpath()
moveto(17.5,0.5*hw)
lineto(11,0.5*hw)
moveto(17.5,-0.5*hw)
lineto(11,-0.5*hw)
stroke(pink)
grestore()

gsave()
setdash([ds,ds], 0)
newpath()
moveto(16,0)
rlineto(-5,0)
stroke(pink)
grestore()

setarrowdims(sw, hw)
for i in range(0,3):
	setlinecap(2-i)
	newpath()
	arrow(16,0)
	if (i == 2):
		stroke(0)
	else:
		stroke(grey)
newpath()
circle(0,0,0.1)
fill()

A = 24*math.pi/180.0
B = 60*math.pi/180.0
x = 0.5*hw/math.tan(A)
y = 0.5*hw/math.tan(B)

setdeg()
setfont("/Helvetica", 0.5)
gsave()
setcolor(pink)
moveto(16,0)
rmoveto(-1.4, 0.08)
show("A")
moveto(16-x+y,0)
rmoveto(-0.68, 0.1)
show("B")

newpath()
arc(16,0,1.72,180-24, 180)
stroke()

newpath()
arc(16-x+y,0,0.9,180-60, 180)
stroke(pink)

gsave()
setdash([ds,ds], 0)
translate(16-x+y,0)
newpath()
moveto(0,0)
lineto(-y*sw/hw,0.5*sw)
stroke(pink)
grestore()

gsave()
setarrowdims(0.05,0.24)
translate(17.25,0)
newpath()
arrow(0,0.5*hw)
fill(pink)
newpath()
arrow(0,-0.5*hw)
fill(pink)
grestore()

gsave()
setarrowdims(0.05,0.24)
translate(-1.75,0)
newpath()
arrow(0,0.5*sw)
fill(pink)
newpath()
arrow(0,-0.5*sw)
fill(pink)
grestore()
grestore()




grestore()

gsave()
setcolor(pink)
translate(11,58)
scale(1.32)
t = texinsert("sw")
newpath()
box(-2,-2,t.width+4,t.height+4)
fill(1)
place(t)
grestore()

gsave()
setcolor(pink)
translate(523,58)
scale(1.32)
t = texinsert("hw")
newpath()
box(-2,-2,t.width+4,t.height+4)
fill(1)
place(t)
grestore()


endpage()
finish()
