procedure main(av) if match("-fpp=", av[1]) then onePixelFt := numeric(pop(av)[6:0]) else onePixelFt := 10.33 / 54 # 45' / 78 pixels = 0.26 feet per pixel # the default on NMSU's sh1.gif # onePixelFt := 45 / 78.0 if match("-origin=", av[1]) then { origin := pop(av)[9:0] origin ? { originx := integer(tab(many(&digits))) ="," originy := integer(tab(many(&digits))) } } else { originx := 188 originy := 60 } &window := open("Frank Harary Normal Calculator, v2","g", "image=" || (av[1] | "2.gif"))| stop("usage: fhn [-fpp=n] [-origin=x,y] floor_plan_file.gif") Fg("red") DrawSegment(44,19, 46, 21, 46, 19, 44, 21) sx1 := 294 sy1 := 252 sx2 := 372 sy2 := 252 # WAttrib("label=Scale: one pixel = " || onePixelFt || " feet") # delay(4000) onePixelMt := onePixelFt / 3.281 WAttrib("label=Scale: one pixel = " || onePixelMt || " meters. Click any pixel for its FHN.") while (e := Event()) ~=== "q" do { if e === (&ldrag | &rdrag | &mdrag) then next x := (&x - originx) y := (&y - originy) if x === lastx & y === lasty then next # write("FHN(",&x,",",&y,") [base ",x,",",y,"]: ", x * onePixelFt, " , ", y * onePixelFt, " in feet") write("FHN(",&x,",",&y,") [base ",x,",",y,"]: ", x * onePixelMt, " , ", y * onePixelMt, " in FHN meters") lastx := x lasty := y } end