<!-- 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) 
  200  (>L:PkyLEFTGEARBOGGIE,percent)
  100  (>L:PkyRIGHTGEARHEIGHT,percent) 
  200  (>L:PkyRIGHTGEARBOGGIE,percent)
  100  (>L:PkyNOSEGEARHEIGHT,percent) 
  
}
els{
    <!--        NOSE GEAR Calculation        -->
    
    4.634  (A:PLANE ALT ABOVE GROUND, meter) - 
    (A:PLANE PITCH DEGREES, radian)  tan  27.82 * +
     153.846 * 
     100 +
     200 min
     100 max
     (>L:PkyNOSEGEARHEIGHT,percent)
     
    <!--        BODY GEAR Calculation        -->
    <!--        BODY GEAR Calculation        -->
    <!--        (A:ATTITUDE INDICATOR BANK DEGREES, radian)  tan  1.74 *        -->
    <!-- Calculate bank offset  -->
    (A:PLANE BANK DEGREES, radian) s8 pi &gt; if{
      l8 pi 2 * -  tan 1.74 *
    }
    els{
      l8  tan 1.74 *
    }
    s9
    
    
    <!-- Calculate Left gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   3.788 * +
    l9 -
    4.629 min
    s0
    
    <!-- Calculate Right gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   3.788 * +
    l9 +
    4.629 min
    s1
    
    4.629 l0  - 166.7 * 100 +  
     200 min
     100 max    
    (>L:PkyLEFTGEARHEIGHT,percent) 
    4.629 l1  - 166.7 * 100 +  
     200 min
     100 max    
    (>L:PkyRIGHTGEARHEIGHT,percent) 
    
    
    
    <!-- Calculate Left boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   4.60 * +
    l9 -
     4.765 min
    s2
    
    <!-- Calculate Right boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   4.60 * +
    l9 +
     4.765 min
    s3    
    
    l0 l2 - 735.294 * 1 *  300 +
     400 min
     200 max    
    (>L:PkyLEFTGEARBOGGIE,percent)
    
    l1 l3 - 735.294 * 1 *  300 +
     400 min
     200 max    
    (>L:PkyRIGHTGEARBOGGIE,percent)
    
     
    <!--        Wing GEAR Calculation        -->
    <!--        Wing GEAR Calculation        -->
    <!--        (A:ATTITUDE INDICATOR BANK DEGREES, radian)  tan  5.508 *        -->
    <!-- Calculate bank offset  -->
    (A:PLANE BANK DEGREES, radian) s8 pi &gt; if{
      l8 pi 2 * -  tan 5.508 *
    }
    els{
      l8  tan 5.508 *
    }
    s9
    
    
    <!-- Calculate Left gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   0.803 * +
    l9 -
    4.555 min
    s0
    
    <!-- Calculate Right gear height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   0.803 * +
    l9 +
    4.555 min
    s1
    
    4.555 l0  - 200 * 100 +  
     200 min
     100 max    
    (>L:PkyLEFTWGEARHEIGHT,percent) 
    
    4.555 l1  - 200 * 100 +  
     200 min
     100 max    
    (>L:PkyRIGHTWGEARHEIGHT,percent) 
    
    
    <!-- Calculate Left boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   1.390 * +
    l9 -
     5.041 min
    s2
    
    <!-- Calculate Right boggie height  -->
    (A:PLANE ALT ABOVE GROUND, meter)
    (A:PLANE PITCH DEGREES, radian)  tan   1.390 * +
    l9 +
     5.041 min
    s3    
    
    l0 l2 - 210 * 1 *  300 +
     400 min
     200 max    
    (>L:PkyLEFTWGEARBOGGIE,percent)
    
    l1 l3 - 210 * 1 *  300 +
     400 min
     200 max    
    (>L:PkyRIGHTWGEARBOGGIE,percent)
    
}

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