<!-- This guage is for Posky 767V5 gear action   -->
<Gauge Name="Pkygear_calc" Version="1.0">
<copyright>(c)2007 Hiroshi Igami</copyright>

<Size X="20" Y="20"/>
<Element>
<Select>
<Value> 

(A:PLANE ALT ABOVE GROUND, meter) 50 &gt; if{
  100  (>L:PkyLEFTGEARHEIGHT,percent) 
  390  (>L:PkyLEFTGEARBOGGIE,percent)
  100  (>L:PkyRIGHTGEARHEIGHT,percent) 
  390  (>L:PkyRIGHTGEARBOGGIE,percent)
  100  (>L:PkyNOSEGEARHEIGHT,percent) 

}
els{
    <!-- Calculate bank offset  -->
    (A:PLANE BANK DEGREES, radian) s8 pi &gt; if{
      l8 pi 2 * -  tan 4.49 *
    }
    els{
      l8  tan 4.49 *
    }
    <!--        (A:ATTITUDE INDICATOR BANK DEGREES, radian)  tan  4.49 *        -->
    s3
    
    <!-- Calculate Left gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   0.5 * -
    l3 -
    4.88 min
    s0
    
    <!-- Calculate Left boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   1.251 * -
    l3 -
     5.10 min
    s1
    
    <!-- Calculate Right gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   0.5 * -
    l3 +
    4.88 min
    s4
    
    <!-- Calculate Right boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   1.251 * -
    l3 +
     5.10 min
    s5
    
     4.88 l0  - 181.8181 * 100 +  
    (>L:PkyLEFTGEARHEIGHT,percent) 
    
    l0 l1 - 450 * -1 *  300 +
    (>L:PkyLEFTGEARBOGGIE,percent)
    
    
    4.88 l4  - 181.8181 * 100 +  
    (>L:PkyRIGHTGEARHEIGHT,percent) 
    
    l4 l5 - 450 * -1 *  300 +
    (>L:PkyRIGHTGEARBOGGIE,percent)
    
    4.611  (A:PLANE ALT ABOVE GROUND, meter) - 
    (A:PLANE PITCH DEGREES, radian)  tan  23.219 * + 
    200 * 100 + 200 min 100 max
    (>L:PkyNOSEGEARHEIGHT,percent) 
}

</Value>
</Select>
</Element>  
</Gauge>
