• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

Circuit width - a better way ?

Messages
542
Country
australia
I have developed a method to calculate the circuit width , however I suspect that
the five element sections might possibly be all incorporated into one element section ,
but I have no idea how to do it.

It's in a previously mentioned "Mark Position" instrument.

Basics :-
1. You capture the aircraft's position (Lat/Long) , plus it's Heading.
That is fed into a Geocalc to get both Bearing and Distance.
2. The captured Heading can then be used as an extended runway centerline.
3. The
- Captured position .
- Extended runway centerline (heading) .
- The aircraft's current location and Bearing and Distance.

all can be used in a Tangent calculation to determine the current Circuit width.
The aircraft's current position is considered as being on a line that is parallel to
the extended runway centerline line.

To cover all four legs of a circuit it is necessary to do four separate calculation strings ,
one for each quadrant centered on the captured "Mark Position .

The first element section defines a 360 degree circle about the Mark position commencing
from the ' Extended runway centerline (heading) '.

The next four elements deal with each quadrant using a Visability statement to
define the angular range for each.

This shot might make it a little clearer,

C9aYt.jpg


The elements look similar to a conditional statement with 4 conditions each having their own
calculation.

This the the Element code, ( it works )
Code:
<!--CIRCUIT WIDTH START--> 
<!--DEFINE  1 - 360 degrees relative to nose ** from Mk Pos to  A/C --> 
      <Element>
          <Position X="1" Y="150"/>
            <FormattedText X="33" Y="8" Font="Tahoma" FontSize="8" LineSpacing="8" Adjust="Right" Color="#000000" Bright="Yes">
              <String>%((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor rddg 360 - abs (&gt;L:QuadrantSectors, degrees) )%!5.1f!%</String>
          </FormattedText>
       </Element>
    
<!--QUADRANT # 1 *** 001 to 090 degrees = circuit Width-->        
    <Element Name="1-4 QUAD">
        <Position X="0" Y="0"/>
        <Visible>(L:QuadrantSectors, degrees) 0.1 &gt; (L:QuadrantSectors, degrees) 90 &lt; and</Visible> 
      <Element>
          <Position X="40" Y="150"/>
            <FormattedText X="130" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
              <String>%Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 * - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-F%</String>
          </FormattedText>
       </Element>            
    </Element>
<!--QUADRANT # 2 *** 091 to 180 degrees = circuit Width-->     
    <Element Name="2-4 QUAD">
        <Position X="0" Y="0"/>
        <Visible>(L:QuadrantSectors, degrees) 90.1 &gt; (L:QuadrantSectors, degrees) 180 &lt; and</Visible> 
      <Element>
          <Position X="40" Y="150"/>
            <FormattedText X="130" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
              <String>%Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-R%    </String>
          </FormattedText>
       </Element>            
    </Element> 
<!--QUADRANT # 3 *** 181 to 270 degrees = circuit Width-->     
    <Element Name="3-4 QUAD">
        <Position X="0" Y="0"/>
        <Visible>(L:QuadrantSectors, degrees) 180.1 &gt; (L:QuadrantSectors, degrees) 270 &lt; and</Visible> 
      <Element>
          <Position X="40" Y="150"/>
             <FormattedText X="130" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
              <String>%Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-R%</String>
          </FormattedText>
       </Element>            
    </Element> 
<!--QUADRANT # 4 *** 271 to 360 degrees = circuit Width-->     
    <Element Name="4-4 QUAD">
        <Position X="0" Y="0"/>
        <Visible>(L:QuadrantSectors, degrees) 270.1 &gt; (L:QuadrantSectors, degrees) 360 &lt; and</Visible> 
      <Element>
          <Position X="40" Y="150"/>
             <FormattedText X="130" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
              <String>%Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-F%</String>
          </FormattedText>
       </Element>            
    </Element>
<!--CIRCUIT WIDTH END-->

Any ideas to incorporate it into one Element ?

Cheers
Karol
 
Last edited:
Extremely cool!!
I did some similar calc with "runway weight" some time ago.

I wrote two element into one. I hope this is was you wanted!!?

HTML:
<!--QUADRANT # 1 *** 001 to 180 degrees = circuit Width-->       
    <Element Name="1-4 QUAD">
       <Position X="40" Y="150"/>
       <FormattedText X="130" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
       <String>
         %((L:QuadrantSectors, degrees) 0.0 &gt;)
         %((L:QuadrantSectors, degrees) 90 &lt;=)
         %(&amp;&amp;)
         %{if}
            %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 * - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-F%
         %{end}
         %((L:QuadrantSectors, degrees) 90 &gt;)
         %((L:QuadrantSectors, degrees) 180 &lt;=)
         %(&amp;&amp;)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-R%
         %{end}
       </String>
       </FormattedText>
    </Element>
I didn't test it. So maybe some syntax error.

A small excerpt from a gauge.
Code:
  <Element>
    <Position X="24" Y="129"/>
    <FormattedText X="196" Y="82" Luminous="Yes" Font="glassga"
         Tabs="0,115R,157R,192R" Color="0xD0D0D0" FontSize="21" Adjust="left" >
    <Color Value="orange"/>
    <Color Value="red"/>
    <String>
    %\{line=196}%\n
    %(0 s0)
    %((L:NavM_POST_Apt_Chr1,number) 30 &lt;)
    %{if}
      %\{clr3}
      %        SELECT   an   AIRPORT\{clr1}
      %(1 s0)
    %{end}
    %((A:Vertical speed,feet/minute) 500 &lt;)
    %(1200 10000 (L:NavD_POST_Aircraft_above_APT,feet) rng)
    %((L:NavM_POST_Rwy_Select,number) 0 ==)
    %((L:NavM_DEST_Apt_Chr1,number) 30 &lt;)
    %(l0 0 ==)
    %(&amp;&amp;)
    %(&amp;&amp;)
    %(&amp;&amp;)
    %(&amp;&amp;)
    %{if}
      %(1 s0)
      %((P:ZULU TIME,seconds) 4 % 2 &gt;)
      %{if}
        %(0 s0)
      %{end}
      %(l0 1 ==)
      %{if}
        %((L:NavM_POST_Apt_Chr1,number) chr (L:NavM_POST_Apt_Chr2,number) chr scat (L:NavM_POST_Apt_Chr3,number) chr scat (L:NavM_POST_Apt_Chr4,number) chr scat )%!s!
        %  APT : %\{clr2}  Select a Runway\{clr1}
      %{end}
    %{end}
...
...

I think yon can replace " %(&amp;&amp;)" with "%(and)".

Btw Karol may i asked you to enter your websideaddresse??!

And stay your project freeware??

Keep on!!! Really interesting!!

Edi
 
Hi Edi ,

Thank you for the above code , it looks good , I will try it .

Yes it stays freeware , I will post the full code when it finished , it might be useful to someone.
I have no website , I'm not a developer , just have fun with some instruments .

I have begun to do the ILS guidance bars , the GS bars are done , now to do the lateral guidance
bars , the runway % and runway remaining , then will post code here.

Following shot is current progress.

Cheers
Karol
h7tbJ.jpg
 
Edi ,

That was really neat , thank you so much for that code .
I even included the angular define element into it , now all 5 elements are in 1 element .
Test flew it and it worked .

Following is the code that I am now using ,
Code:
<!--CIRCUIT WIDTH START-->      
<!--QUADRANT # 1  to 4*** 001 to 360 degrees = circuit Width-->   
      <Element>
          <Position X="35" Y="150"/>
            <FormattedText X="140" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
       <String>
         %((L:QuadrantSectorsDefine, enum) 0 == )
         %{if}
            %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor rddg 360 - abs (&gt;L:QuadrantSectors, degrees) )%
         %{end}          
         %((L:QuadrantSectors, degrees) 0.1 &gt; (L:QuadrantSectors, degrees) 90 &lt; and)
         %{if}
            %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 * - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-F%
         %{end}
         %((L:QuadrantSectors, degrees) 90.1 &gt; (L:QuadrantSectors, degrees) 180 &lt; and)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-R%
         %{end}
        
         %((L:QuadrantSectors, degrees) 180.1 &gt; (L:QuadrantSectors, degrees) 270 &lt; and)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-R%
         %{end}
         %((L:QuadrantSectors, degrees) 270.1 &gt; (L:QuadrantSectors, degrees) 360 &lt; and)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-F%
         %{end}        
       </String>
          </FormattedText> 
       </Element>                 
<!--CIRCUIT WIDTH END-->

Cheers
Karol
 
Edi ,

Looking at the second block of script that you provided above , this bit caught my attention ,
Code:
    %(1200 10000 (L:NavD_POST_Aircraft_above_APT,feet) rng)

Well I couldn't resist trying it , and it works as well !
Code:
<!--CIRCUIT WIDTH START-->      
<!--QUADRANT # 1  to 4*** 001 to 360 degrees = circuit Width-->   
      <Element>
          <Position X="35" Y="150"/>
            <FormattedText X="140" Y="12" Font="Tahoma" FontSize="11" LineSpacing="11" Adjust="Right" Color="#787878" Bright="Yes">
       <String>
         %((L:QuadrantSectorsDefine, enum) 0 == )
         %{if}
            %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor rddg 360 - abs (&gt;L:QuadrantSectors, degrees) )%
         %{end}          
         %(0.1 90 (L:QuadrantSectors, degrees) rng)
         %{if}
            %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 * - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-F%
         %{end}
         %(90.1 180 (L:QuadrantSectors, degrees) rng)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Right-R%
         %{end}        
         %(180.1 270 (L:QuadrantSectors, degrees) rng)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi - atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-R%
         %{end}
         %(270.1 360 (L:QuadrantSectors, degrees) rng)
         %{if}
           %Cct Width %((L:HEADINGsavedMarkPos, radians) (L:BearingMarkPos,radians) (A:GPS MAGVAR, radians) - - rnor pi 2 / - pi 2 / + atg (L:DistanceMarkPos,nmiles) * abs )%!6.2f!% nm Left-F%
         %{end}        
       </String>
          </FormattedText> 
       </Element>                 
<!--CIRCUIT WIDTH END-->

You provided two solutions , both in the same post.

Again my thanks.

Cheers
Karol
 
Back
Top