<!-- 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) 20 &lt; if{

<!-- Nose gear action   Strut 0.625 so 100/0.625 is 160 -->
    5.419  (A:PLANE ALT ABOVE GROUND, meter) - 
    (A:PLANE PITCH DEGREES, radian)  tan  19.74 * + 
    160 * 100 + 
    200 min 100 max
    (>L:TdsNOSEGEARHEIGHT,percent) 

<!-- Calculate bank offset  -->
<!-- s3 = Main Gear pole height difference by bank angle  -->
    (A:PLANE BANK DEGREES, radian) s8 pi &gt; if{
      l8 pi 2 * -  tan 5.706 *
    }
    els{
      l8  tan 5.706 *
    }
    <!--        (A:ATTITUDE INDICATOR BANK DEGREES, radian)  tan  5.076 *        -->
    s3

<!-- Gear pole action   -->
<!-- s1 = Main Gear pole height without bank angle  -->
    5.70  (A:PLANE ALT ABOVE GROUND, meter) - 
    (A:PLANE PITCH DEGREES, radian)  tan  3.053 * - 
    l3 +
    180.831 * 100 + 
    200 min 100 max
    (>L:TdsLEFTGEARHEIGHT,percent)
    
    5.70  (A:PLANE ALT ABOVE GROUND, meter) - 
    (A:PLANE PITCH DEGREES, radian)  tan  3.053 * - 
    l3 -
    180.831 * 100 + 
    200 min 100 max
    (>L:TdsRightGEARHEIGHT,percent) 
    
    
    
    
    (A:GEAR LEFT POSITION,percent) 99 &lt; if{
       99 (A:GEAR LEFT POSITION,percent) - 15 *
       225 +
       360 min
       
    }
    els{
        (L:TdsLEFTGEARHEIGHT,percent) 100 == if{
           5.90  (A:PLANE ALT ABOVE GROUND, meter) - 
           (A:PLANE PITCH DEGREES, radian)  tan  3.819 * - 
           l3  +
           362.3188 * 225 +
        }
        els{
           (A:PLANE PITCH DEGREES, degree)  -5.0 * 300 +
         }    
    }
    375 min 225 max
   (>L:TdsLEFTGEARBOGGIE,percent) 
    (A:GEAR RIGHT POSITION,percent) 99 &lt; if{
       99 (A:GEAR RIGHT POSITION,percent) - 15 *
       225 +
       360 min
       
    }
    els{
        (L:TdsRIGHTGEARHEIGHT,percent) 100 == if{
           5.90  (A:PLANE ALT ABOVE GROUND, meter) - 
           (A:PLANE PITCH DEGREES, radian)  tan  3.819 * - 
           l3  -
           362.3188 * 225 +
        }
        els{
           (A:PLANE PITCH DEGREES, degree)  -5.0 * 300 +
         }    
    }
    375 min 225 max
    (>L:TdsRIGHTGEARBOGGIE,percent) 
}
els{
    100 (>L:TdsRIGHTGEARHEIGHT,percent)
    100 (>L:TdsLEFTGEARHEIGHT,percent)
     (A:GEAR LEFT POSITION,percent) 99 &lt; if{
       99 (A:GEAR LEFT POSITION,percent) - 15 *
       225 +
       360 min
     }
     els{
       225
     }
    (>L:TdsLEFTGEARBOGGIE,percent) 
    
     (A:GEAR RIGHT POSITION,percent) 99 &lt; if{
       99 (A:GEAR RIGHT POSITION,percent) - 15 *
       225 +
       360 min
     }
     els{
       225
     }
    (>L:TdsRIGHTGEARBOGGIE,percent) 
}
</Value>
</Select>
</Element>  
</Gauge>
