--[[ The program runs on all color remote controls After starting the program in Emulator, the screen is initially blank because the two diameters on the controllers P5 and P6 have the same diameter Please change one of these controls first! P2 = transparency P3 = x-Position P4 = y-Position P5 = circle diameter 1 P6 = circle diameter 2 P7 = startiing angle P8 = angle quantity Sa = normal or reverse drawArc(x,y,d1,d2,von,bis,rev) x,y = position on screen d1,d2 = circle diameter 1 and 2 Which diameter is smaller or larger is not important von = starting angle 0 is down and rising to the right bis = angle quantity rev = if false then arc goes from left to right, if true reversed --]] local Bogen=lcd.renderer() local function drawArc(x,y,d1,d2,von,bis,rev) Bogen:reset() local step1,step2 if rev then v=von-bis b=von else v=von b=bis+v end if d1<10 then step1=30 -- this is only to reduce computing time elseif d1<80 then step1=12 -- the smaller the diameter, the fewer points elseif d1<120 then step1=9 -- for the first circle else step1=6 -- end if d2<10 then step2=-30 -- this is only to reduce computing time elseif d2<80 then step2=-12 -- the smaller the diameter, the fewer points elseif d2<120 then step2=-9 -- for the second circle else step2=-7 -- end for _=v,b,step1 do Bogen:addPoint(x+(-d1*math.sin(math.rad(_))),y+(d1*math.cos(math.rad(_)))) end Bogen:addPoint(x+(-d1*math.sin(math.rad(b))),y+(d1*math.cos(math.rad(b)))) for _=b,v,step2 do Bogen:addPoint(x+(-d2*math.sin(math.rad(_))),y+(d2*math.cos(math.rad(_)))) end Bogen:addPoint(x+(-d2*math.sin(math.rad(v))),y+(d2*math.cos(math.rad(v)))) end local function printForm(w,h,formId) lcd.setColor(255,0,0) if system.getInputs("SA")==1 then sa=false else sa=true end drawArc( (system.getInputs("P3")+1)*w/2, h-(system.getInputs("P4")+1)*h/2, (system.getInputs("P5")+1)*w/4, (system.getInputs("P6")+1)*w/4, (system.getInputs("P7")+1)*180, (system.getInputs("P8")+1)*180, sa) Bogen:renderPolygon((system.getInputs("P2")+1)/2) end local function init() system.registerTelemetry(1,"Cockpit "..system.getProperty ("Model"),5,printForm) end return {init=init,author="Test",version="0.00",name="ARC"}