X3D Model Documentation: TRC170PairPrototype.x3d

  1  <?xml version="1.0" encoding="UTF-8"?>
  2 
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
  3  <X3D profile='Immersive' version='3.0 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  4       <head>
  5            <meta name='titlecontent='TRC170PairPrototype.x3d'/>
  6            <meta name='descriptioncontent='A Pair of TRC-170s. A TRC-170 is a long-range SHF communication system. It operates in 3 modes. 1)Direct point-to-point link (< 30 miles). 2) Tropospheric shot (up to 100 or 150 miles, depending on system version). 3) Defraction shot over an a terrain feature or object in the path ( < 50 miles).'/>
  7            <meta name='creatorcontent='Mike Hunsberger'/>
  8            <meta name='createdcontent='8 May 2001'/>
  9            <meta name='modifiedcontent='12 October 2023'/>
 10            <meta name='identifiercontent='https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototype.x3d'/>
 11            <meta name='generatorcontent='X3D-Edit 4.0, https://savage.nps.edu/X3D-Edit'/>
 12            <meta name='licensecontent='../../license.html'/>
 13       </head>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: BeamSwitch, BeamSwitch2, CalculateAngleScript, HighAbove, HighAboveXZTranslation, TransmitScript, TransmitScript2, TRC1_BEAMCONE, TRC1_BEAMCYLINDER, TRC1_TRANSFORM, TRC1_XY_TRANSFORM, TRC1Cone, TRC1Viewpoint, TRC2_BEAMCONE, TRC2_BEAMCYLINDER, TRC2_TRANSFORM, TRC2_XY_TRANSFORM, TRC2Cone, TRC2Viewpoint, TRCBody, TRCStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, HighAbove, TRC1Viewpoint, TRC2Viewpoint

Index for ExternProtoDeclare definitions: BeamCone, BeamCylinder

Index for ProtoDeclare definition: TRC170Pair
-->
 14       <Scene>
 15            <ExternProtoDeclare name='BeamCylinderappinfo='Produce wireframe or transparent beam cylinders. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).'   url=' "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" '>
 16                 <field name='contacttype='SFBoolaccessType='inputOnly'
                appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/>
 17                 <field name='rangetype='SFFloataccessType='inputOnly'
                appinfo='distance in meters along x axis'/>
 18                 <field name='defaultRangetype='SFFloataccessType='initializeOnly'
                appinfo='distance in meters used until eventIn range sent'/>
 19                 <field name='wireframetype='SFBoolaccessType='initializeOnly'
                appinfo='whether wireframe beam is drawn'/>
 20                 <field name='solidtype='SFBoolaccessType='initializeOnly'
                appinfo='whether solid beam is drawn'/>
 21                 <field name='beamHeighttype='SFFloataccessType='initializeOnly'
                appinfo='meters across vertical y axis'/>
 22                 <field name='beamWidthtype='SFFloataccessType='initializeOnly'
                appinfo='meters across horizontal z axis'/>
 23                 <field name='contactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=true'/>
 24                 <field name='noContactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=false'/>
 25                 <field name='transparencytype='SFFloataccessType='inputOutput'
                appinfo='1 = fully transparent wireframe only'/>
 26                 <field name='nametype='SFStringaccessType='initializeOnly'
                appinfo='Assigning a name to a BeamCylinder aids tracing'/>
 27            </ExternProtoDeclare>
 28            <ExternProtoDeclare name='BeamConeappinfo='Produce wireframe or transparent beam cones. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).'   url=' "../../CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "../../CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone" '>
 29                 <field name='contacttype='SFBoolaccessType='inputOnly'
                appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?'/>
 30                 <field name='rangetype='SFFloataccessType='inputOnly'
                appinfo='distance in meters along x axis'/>
 31                 <field name='defaultRangetype='SFFloataccessType='initializeOnly'
                appinfo='distance in meters used until eventIn range sent'/>
 32                 <field name='wireframetype='SFBoolaccessType='initializeOnly'
                appinfo='whether wireframe beam is drawn'/>
 33                 <field name='solidtype='SFBoolaccessType='initializeOnly'
                appinfo='whether solid beam is drawn'/>
 34                 <field name='beamHeightDegreestype='SFFloataccessType='initializeOnly'
                appinfo='degrees across vertical y axis'/>
 35                 <field name='beamWidthDegreestype='SFFloataccessType='initializeOnly'
                appinfo='degrees across horizontal z axis'/>
 36                 <field name='contactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=true'/>
 37                 <field name='noContactColortype='SFColoraccessType='initializeOnly'
                appinfo='rendering color when contact=false'/>
 38                 <field name='transparencytype='SFFloataccessType='inputOutput'
                appinfo='1 = fully transparent wireframe only'/>
 39                 <field name='nametype='SFStringaccessType='initializeOnly'
                appinfo='BeamCone name aids in node identification and tracing'/>
 40                 <field name='traceEnabledtype='SFBoolaccessType='initializeOnly'
                appinfo='flag to turn on Script tracing'/>
 41            </ExternProtoDeclare>
 42            <!-- ExternProtoDeclare definitions must be included verbatim -->
 43            <!-- PROTO consists of two TRC170 for long range (up to 100 mile) point-to-point communication. TRC170s can be used in 3 different settings. The first is a direct link of up to 30 miles. The second is a defraction setting over an obstruction in the path. The third is a tropospheric scatter shot of up to 100 miles in which the signal is bounced off the troposphere. This PROTO allows specification for the initial placement of each TSSR. It automatically calculates the correct angle to complete the link. -->
 44            <ProtoDeclare name='TRC170Pair'>
 45                 <ProtoInterface>
 46                      <field name='TRC1Locationtype='SFVec3fvalue='1 1 1accessType='initializeOnly'/>
 47                      <field name='TRC2Locationtype='SFVec3fvalue='0 0 0accessType='initializeOnly'/>
 48                      <field name='OperatingModetype='SFStringvalue='DIRECTaccessType='initializeOnly'/>
 49                 </ProtoInterface>
 50                 <ProtoBody>
 51                      <Group>
 52 
                         <!-- ROUTE information for HighAboveXZTranslation node:  [from CalculateAngleScript.HighAboveViewpoint to translation ] [from CalculateAngleScript.HighAboveTranslationAngle to rotation ] -->
                         <Transform DEF='HighAboveXZTranslation'>
 53                                <Viewpoint DEF='HighAbovedescription='High Above TRC170orientation='1 0 0 -1.4position='0 0 0'/>
 54                           </Transform>
 55 
                         <!-- ROUTE information for TRC1Viewpoint node:  [from CalculateAngleScript.TRC1_Viewpoint to position ] [from CalculateAngleScript.TRC1_ViewpointAngle to orientation ] -->
                         <Viewpoint DEF='TRC1Viewpointdescription='TRC170 #1'/>
 56 
                         <!-- ROUTE information for TRC2Viewpoint node:  [from CalculateAngleScript.TRC2_Viewpoint to position ] [from CalculateAngleScript.TRC2_ViewpointAngle to orientation ] -->
                         <Viewpoint DEF='TRC2Viewpointdescription='TRC170 #2'/>
 57                           <LOD range='200000'>
 58                                <!-- TRC 1 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TRC body, stand, and the dome pattern. -->
 59 
                              <!-- ROUTE information for TRC1_TRANSFORM node:  [from CalculateAngleScript.TRC1_XZangle to rotation ] -->
                              <Transform DEF='TRC1_TRANSFORMtranslation='-2 0 0'>
 60                                     <IS>
 61                                          <connect nodeField='translationprotoField='TRC1Location'/>
 62                                     </IS>
 63 
                                   <!-- ROUTE information for TRC1_XY_TRANSFORM node:  [from CalculateAngleScript.TRC1_XYangle to rotation ] -->
                                   <Transform DEF='TRC1_XY_TRANSFORMtranslation='1 5 0'>
 64 
                                        <!-- Inline TRCBody is a DEF node that has 1 USE node: USE_1 -->
                                        <Inline DEF='TRCBody'   url=' "TRC170Dish.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "TRC170Dish.wrl" "../../CommunicationsAndSensors/TRC170/TRC170Dish.wrl" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.wrl" '/>
 65                                          <Transform DEF='TRC1Conetranslation='2 0 0'>
 66 
                                             <!-- ROUTE information for BeamSwitch node:  [from CalculateAngleScript.WhichBeam to whichChoice ] -->
                                             <Switch DEF='BeamSwitchwhichChoice='0'>
 67                                                    <Group>
 68 
                                                       <!-- ROUTE information for TRC1_BEAMCYLINDER node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCylinderDEF='TRC1_BEAMCYLINDER'>
 69                                                              <fieldValue name='defaultRangevalue='10'/>
 70                                                              <fieldValue name='beamHeightvalue='1.5'/>
 71                                                              <fieldValue name='beamWidthvalue='1.5'/>
 72                                                              <fieldValue name='transparencyvalue='0.2'/>
 73                                                              <fieldValue name='wireframevalue='true'/>
 74                                                              <fieldValue name='solidvalue='true'/>
 75                                                              <fieldValue name='contactColorvalue='.3 .5 .5'/>
 76                                                              <fieldValue name='noContactColorvalue='.8 .1 .1'/>
 77                                                         </ProtoInstance>
 78                                                    </Group>
 79                                                    <Group>
 80 
                                                       <!-- ROUTE information for TRC1_BEAMCONE node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamConeDEF='TRC1_BEAMCONE'>
 81                                                              <fieldValue name='defaultRangevalue='10'/>
 82                                                              <fieldValue name='beamHeightDegreesvalue='2'/>
 83                                                              <fieldValue name='beamWidthDegreesvalue='2'/>
 84                                                              <fieldValue name='transparencyvalue='0.2'/>
 85                                                              <fieldValue name='wireframevalue='true'/>
 86                                                              <fieldValue name='solidvalue='true'/>
 87                                                              <fieldValue name='noContactColorvalue='.8 .1 .1'/>
 88                                                              <fieldValue name='contactColorvalue='.3 .5 .5'/>
 89                                                         </ProtoInstance>
 90                                                    </Group>
 91                                               </Switch>
 92                                          </Transform>
 93                                     </Transform>
 94                                     <Transform>
 95 
                                        <!-- Inline TRCStand is a DEF node that has 1 USE node: USE_1 -->
                                        <Inline DEF='TRCStand'   url=' "TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.wrl" "TRC170Tripod.wrl" "https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.wrl" '/>
 96                                          <LOD range='500'>
 97                                               <Viewpoint description='TRC170 Side Viewposition='0 5 40'/>
 98                                               <WorldInfo info='"null node for no rendering when distant"'/>
 99                                          </LOD>
100                                     </Transform>
101                                </Transform>
102                                <WorldInfo info='"null node for no rendering when distant"'/>
103                           </LOD>
104                           <LOD range='200000'>
105                                <!-- TRC 2 Two Transforms. One in the XZ plane, the second in the XY plane. Inlines for the TRC body, stand, and the dome pattern. -->
106 
                              <!-- ROUTE information for TRC2_TRANSFORM node:  [from CalculateAngleScript.TRC2_XZangle to rotation ] -->
                              <Transform DEF='TRC2_TRANSFORMtranslation='-2 0 0'>
107                                     <IS>
108                                          <connect nodeField='translationprotoField='TRC2Location'/>
109                                     </IS>
110 
                                   <!-- ROUTE information for TRC2_XY_TRANSFORM node:  [from CalculateAngleScript.TRC2_XYangle to rotation ] -->
                                   <Transform DEF='TRC2_XY_TRANSFORMtranslation='1 5 0'>
111                                          <Inline USE='TRCBody'/>
112                                          <Transform DEF='TRC2Conetranslation='2 0 0'>
113 
                                             <!-- ROUTE information for BeamSwitch2 node:  [from CalculateAngleScript.WhichBeam to whichChoice ] -->
                                             <Switch DEF='BeamSwitch2whichChoice='0'>
114                                                    <Group>
115 
                                                       <!-- ROUTE information for TRC2_BEAMCYLINDER node:  [from CalculateAngleScript.TRC2_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamCylinderDEF='TRC2_BEAMCYLINDER'>
116                                                              <fieldValue name='defaultRangevalue='10'/>
117                                                              <fieldValue name='beamHeightvalue='1.5'/>
118                                                              <fieldValue name='beamWidthvalue='1.5'/>
119                                                              <fieldValue name='transparencyvalue='0.2'/>
120                                                              <fieldValue name='wireframevalue='true'/>
121                                                              <fieldValue name='solidvalue='true'/>
122                                                              <fieldValue name='contactColorvalue='.3 .5 .5'/>
123                                                              <fieldValue name='noContactColorvalue='.8 .1 .1'/>
124                                                         </ProtoInstance>
125                                                    </Group>
126                                                    <Group>
127 
                                                       <!-- ROUTE information for TRC2_BEAMCONE node:  [from CalculateAngleScript.TRC1_beamLength to range ] [from CalculateAngleScript.LinkEstablished to contact ] -->
                                                       <ProtoInstance name='BeamConeDEF='TRC2_BEAMCONE'>
128                                                              <fieldValue name='defaultRangevalue='10'/>
129                                                              <fieldValue name='beamHeightDegreesvalue='2'/>
130                                                              <fieldValue name='beamWidthDegreesvalue='2'/>
131                                                              <fieldValue name='transparencyvalue='0.2'/>
132                                                              <fieldValue name='wireframevalue='true'/>
133                                                              <fieldValue name='solidvalue='true'/>
134                                                              <fieldValue name='noContactColorvalue='.8 .1 .1'/>
135                                                              <fieldValue name='contactColorvalue='.3 .5 .5'/>
136                                                         </ProtoInstance>
137                                                    </Group>
138                                               </Switch>
139                                          </Transform>
140                                     </Transform>
141                                     <Transform>
142                                          <Inline USE='TRCStand'/>
143                                          <LOD range='500'>
144                                               <Transform>
145                                                    <Viewpoint description='TRC170 Side Viewposition='0 5 40'/>
146                                               </Transform>
147                                               <Transform/>
148                                          </LOD>
149                                     </Transform>
150                                </Transform>
151                                <WorldInfo info='"null node"'/>
152                           </LOD>
153                           <Script DEF='TransmitScript'>
154                                <field name='transStatetype='SFInt32accessType='inputOnly'/>
155                                <field name='sizetype='SFVec3faccessType='outputOnly'/>
  <![CDATA[
            
ecmascript:

function initialize ()
{
	size = new SFVec3f(100, 100, 100) ;
	Browser.println ('TransmitScript initialize() complete');
}

// function name matches eventIn variable name ('hour')
// hourValue captures the new value of the ROUTE hour event
// minutes is just the current field value

function transState (newValue, timestamp)
{
	transmitState = newValue ;
	if (transmitState == 3) {
		size = new SFVec3f(10, 10, 10) ;
	}
	else {
		size = new SFVec3f(100, 100, 100) ;
	}
	Browser.println ('size	= ' + size);
}

          
]]>
157                           </Script>
158                           <Script DEF='TransmitScript2'>
159                                <field name='transStatetype='SFInt32accessType='inputOnly'/>
160                                <field name='sizetype='SFVec3faccessType='outputOnly'/>
  <![CDATA[
            
ecmascript:

function initialize ()
{
	size = new SFVec3f(100, 100, 100) ;
	Browser.println ('TransmitScript initialize() complete');
}

// function name matches eventIn variable name ('hour')
// hourValue captures the new value of the ROUTE hour event
// minutes is just the current field value

function transState (newValue, timestamp)
{
	transmitState = newValue ;
	if (transmitState == 3) {
		size = new SFVec3f(10, 10, 10) ;
	}
	else {
		size = new SFVec3f(100, 100, 100) ;
	}
	Browser.println ('size	= ' + size);
}

          
]]>
162                           </Script>
163                           <!-- This script is used to calculate the corresponding rotation angles so the TSSRs will be pointed at each other -->
164 
165                                <field name='TRC1Locationtype='SFVec3faccessType='initializeOnly'/>
166                                <field name='TRC2Locationtype='SFVec3faccessType='initializeOnly'/>
167                                <field name='OperatingModetype='SFStringaccessType='initializeOnly'/>
168                                <field name='TRC1_XZangletype='SFRotationaccessType='outputOnly'/>
169                                <field name='TRC2_XZangletype='SFRotationaccessType='outputOnly'/>
170                                <field name='beamScaletype='SFVec3faccessType='outputOnly'/>
171                                <field name='TRC1_beamLengthtype='SFFloataccessType='outputOnly'/>
172                                <field name='TRC2_beamLengthtype='SFFloataccessType='outputOnly'/>
173                                <field name='TRC1_XYangletype='SFRotationaccessType='outputOnly'/>
174                                <field name='TRC2_XYangletype='SFRotationaccessType='outputOnly'/>
175                                <field name='LinkEstablishedtype='SFBoolaccessType='outputOnly'/>
176                                <field name='TRC1_Viewpointtype='SFVec3faccessType='outputOnly'/>
177                                <field name='TRC2_Viewpointtype='SFVec3faccessType='outputOnly'/>
178                                <field name='TRC1_ViewpointAngletype='SFRotationaccessType='outputOnly'/>
179                                <field name='TRC2_ViewpointAngletype='SFRotationaccessType='outputOnly'/>
180                                <field name='HighAboveViewpointtype='SFVec3faccessType='outputOnly'/>
181                                <field name='HighAboveTranslationAngletype='SFRotationaccessType='outputOnly'/>
182                                <field name='WhichBeamtype='SFInt32accessType='outputOnly'/>
183                                <IS>
184                                     <connect nodeField='TRC1LocationprotoField='TRC1Location'/>
185                                     <connect nodeField='TRC2LocationprotoField='TRC2Location'/>
186                                     <connect nodeField='OperatingModeprotoField='OperatingMode'/>
187                                </IS>
  <![CDATA[
            
ecmascript:

function initialize ()
{
	Browser.println ('TRC1	=' + TRC1Location);
	Browser.println ('TRC2	=' + TRC2Location);
	Browser.println ('TransmitScript initialize() complete');
	active = true ;
	TRC1_XZangle	= new SFRotation(0, 1, 0, 0) ;
	TRC2_XZangle	= new SFRotation(0, 1, 0, 0) ;
	TRC1_XYangle	= new SFRotation(0, 0, 1, 0) ;
	TRC2_XYangle	= new SFRotation(0, 0, 1, 0) ;
	XZangle	= new SFRotation(0, 1, 0, 0) ;
	XYangle	= new SFRotation(0, 0, 1, 0) ;
	TRC1_ViewpointAngle	= new SFRotation(0, 1, 0, 0) ;
	TRC2_ViewpointAngle	= new SFRotation(0, 1, 0, 0) ;
	HighAboveViewpointAngle	= new SFRotation(1, 0, 0, 0) ;
	HighAboveTranslationAngle	= new SFRotation(0, 1, 0, 0) ;

	beamScale	   = new SFVec3f ( ) ;
	center		   = new SFVec3f ( ) ;
	TRC1_Viewpoint	   = new SFVec3f ( ) ;
	TRC2_Viewpoint	   = new SFVec3f ( ) ;
	HighAboveViewpoint = new SFVec3f ( ) ;
	LinkEstablished	= true;
	Browser.println ('OperatingMode	=' + OperatingMode);

	compute(active) ;
}

function compute ( )
{
	if (OperatingMode == 'DIRECT') {
		WhichBeam = 0 ;
		computeDistance( ) ;
		computeXZangle( );
		computeXYangle( ) ;

	}

	if (OperatingMode == 'TROPOSCATTER') {
		WhichBeam = 1 ;
		centerX 	= (TRC2Location[0] - TRC1Location[0])/2 ;
		centerZ 	= (TRC2Location[2] - TRC1Location[2])/2 ;
		XZDistance	= Math.sqrt(centerX * centerX + centerZ * centerZ);
		center[0]	= TRC1Location[0] + centerX;
		center[1]	= 15000 ;  // vertical height of troposphere
		center[2]	= TRC1Location[2] + centerZ;
                Browser.println ('TRC1	= ' + TRC1Location);
                Browser.println ('center	= ' + center);
                Browser.println ('TRC2	= ' + TRC2Location);

		computeTropoDistance(TRC1Location, center) ;
		computeTropoXZangle( );
		computeTropoXYangle( ) ;
		TRC1_beamLength 	= tropoDistance-2;
		TRC1_XZangle		= XZangle;
		TRC1_XYangle		= XYangle;

		computeTropoDistance(TRC2Location, center) ;
		computeTropoXZangle( );
		computeTropoXYangle( ) ;
		TRC2_beamLength 	= tropoDistance-2;
		TRC2_XZangle		= XZangle;
		TRC2_XYangle		= XYangle;
	}

	TRC1_Viewpoint[0]	= TRC1Location[0] + Math.sin(TRC1_XZangle[3] - 1.57)*40;
	TRC1_Viewpoint[1]	= TRC1Location[1] + 10;
	TRC1_Viewpoint[2]	= TRC1Location[2] +Math.cos(TRC1_XZangle[3] - 1.57)*40;
	Browser.println ('TRC1_Viewpoint	'+ TRC1_Viewpoint);
	TRC1_ViewpointAngle[3]	= TRC1_XZangle[3] - 1.57 ;

	TRC2_Viewpoint[0]	= TRC2Location[0] + Math.sin(TRC2_XZangle[3] - 1.57)*40 ;
	TRC2_Viewpoint[1]	= TRC2Location[1] + 10;
	TRC2_Viewpoint[2]	= TRC2Location[2] + Math.cos(TRC2_XZangle[3] - 1.57)*40;
	TRC2_ViewpointAngle[3]	= TRC2_XZangle[3] - 1.57 ;
	Browser.println ('TRC2_Viewpoint	'+ TRC2_Viewpoint);

	HighAboveViewpoint[0]	= center[0] + Math.sin(TRC1_XZangle[3])*3000 ;
	HighAboveViewpoint[1]	= center[1]  + 5000;
	HighAboveViewpoint[2]	= center[2] + Math.cos(TRC1_XZangle[3])*3000 ;
	Browser.println ('HighAboveViewpoint	'+ HighAboveViewpoint);
//	HighAboveViewpointAngle[3]	= Math.cos(TRC1_XZangle[3]) ;
	HighAboveTranslationAngle[3]	= TRC1_XZangle[3] ;
//	Browser.println ('HighAboveTranslationle		'+ HighAboveViewpointAngle);
	Browser.println ('HighAboveXZTranslationAngle	'+HighAboveTranslationAngle);



}

function computeTropoDistance(loc1, loc2 )
{
	tropoDeltaX 	= (loc2[0] - loc1[0]) ;
	tropoDeltaY 	= (loc2[1] - loc1[1]) ;
	tropoDeltaZ 	= (loc2[2] - loc1[2]) ;
	tropoDistanceSquared	= tropoDeltaX * tropoDeltaX + tropoDeltaY * tropoDeltaY + tropoDeltaZ * tropoDeltaZ ;
	Browser.println ('Distance Squared	=' + tropoDistanceSquared);
	tropoDistance 	= Math.sqrt(tropoDistanceSquared) ;
	Browser.println ('Distance	=' + tropoDistance);

	if (XZDistance > 100/.6*1000) {
		LinkEstablished = false;
		//TRC1_beamLength = 5000 ;
		//TRC2_beamLength = 5000 ;
	}
}

function computeTropoXZangle( )
{
	if (tropoDeltaZ == 0) {
		tropoDeltaZ = .00000001 ;
	}

	angle 	= Math.atan(tropoDeltaX/tropoDeltaZ) ;
	if (tropoDeltaZ < 0) {
		XZangle[3] = angle + Math.PI/2;
	}
	else {
		XZangle[3] = angle -  Math.PI/2;
	}
	Browser.println ('Angle	=' + XZangle[3]);
//	Browser.println ('Angle2	=' + TRC2_XZangle[3]);
}


function computeTropoXYangle( )
{
	Browser.println ('tropoDeltaY	=' + tropoDeltaY);
	angle 	= Math.asin(tropoDeltaY/tropoDistance) ;
	XYangle[3] = angle ;
	//XYangle[3]  = - TRC1_XYangle[3];

	Browser.println ('AngleXY	=' +XYangle[3]);
//	Browser.println ('Angle2XY	=' + TRC2_XYangle[3]);
}

function computeDistance( )
{
	Browser.println ('TRC1	=' + TRC1Location);
	Browser.println ('TRC2	=' + TRC2Location);
	deltaX 	= (TRC2Location[0] - TRC1Location[0]) ;
	deltaY 	= (TRC2Location[1] - TRC1Location[1]) ;
	deltaZ 	= (TRC2Location[2] - TRC1Location[2]) ;
	distanceSquared	= deltaX * deltaX + deltaY * deltaY + deltaZ * deltaZ ;
	Browser.println ('Distance Squared	=' + distanceSquared);
	distance 	= Math.sqrt(distanceSquared) ;
	Browser.println ('Distance	=' + distance);

	beamScale[0] 	= distance/10;
	beamScale[1]	= 10;
	beamScale[2]	= 10;
	Browser.println ('BeamScale	=' + beamScale);
	TRC1_beamLength 	= distance -2;
	TRC2_beamLength 	= distance -2;
	if (distance > 5/.6*1000) {
		LinkEstablished = false;
		TRC1_beamLength = 5000/.6 ;
		TRC2_beamLength = 5000/.6 ;
	}
}

function computeXZangle( )
{
	if (deltaZ == 0) {
		deltaZ = .00000001 ;
	}

	angle 	= Math.atan(deltaX/deltaZ) ;
	if (deltaZ < 0) {
		TRC1_XZangle[3] = angle + Math.PI/2;
	}
	else {
		TRC1_XZangle[3] = angle -  Math.PI/2;
	}
	TRC2_XZangle[3]  = TRC1_XZangle[3] +  Math.PI;

	Browser.println ('Angle	=' + TRC1_XZangle[3]);
	Browser.println ('Angle2	=' + TRC2_XZangle[3]);
}



function computeXYangle( )
{
	angle 	= Math.asin(deltaY/distance) ;
	TRC1_XYangle[3] = angle ;
	TRC2_XYangle[3]  = - TRC1_XYangle[3];

	Browser.println ('AngleXY	=' + TRC1_XYangle[3]);
	Browser.println ('Angle2XY	=' + TRC2_XYangle[3]);
}

          
]]>
189                           </Script>
190                      </Group>
191                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_XZangle' toNode='TRC1_TRANSFORM' toField='rotation'/>
192                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_XZangle' toNode='TRC2_TRANSFORM' toField='rotation'/>
193                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC1_BEAMCYLINDER' toField='range'/>
194                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC1_BEAMCONE' toField='range'/>
195                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_beamLength' toNode='TRC2_BEAMCYLINDER' toField='range'/>
196                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_beamLength' toNode='TRC2_BEAMCONE' toField='range'/>
197                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_XYangle' toNode='TRC1_XY_TRANSFORM' toField='rotation'/>
198                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_XYangle' toNode='TRC2_XY_TRANSFORM' toField='rotation'/>
199                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC1_BEAMCYLINDER' toField='contact'/>
200                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC1_BEAMCONE' toField='contact'/>
201                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC2_BEAMCYLINDER' toField='contact'/>
202                      < ROUTE  fromNode='CalculateAngleScript' fromField='LinkEstablished' toNode='TRC2_BEAMCONE' toField='contact'/>
203                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_Viewpoint' toNode='TRC1Viewpoint' toField='position'/>
204                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_Viewpoint' toNode='TRC2Viewpoint' toField='position'/>
205                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC1_ViewpointAngle' toNode='TRC1Viewpoint' toField='orientation'/>
206                      < ROUTE  fromNode='CalculateAngleScript' fromField='TRC2_ViewpointAngle' toNode='TRC2Viewpoint' toField='orientation'/>
207                      < ROUTE  fromNode='CalculateAngleScript' fromField='HighAboveViewpoint' toNode='HighAboveXZTranslation' toField='translation'/>
208                      < ROUTE  fromNode='CalculateAngleScript' fromField='HighAboveTranslationAngle' toNode='HighAboveXZTranslation' toField='rotation'/>
209                      < ROUTE  fromNode='CalculateAngleScript' fromField='WhichBeam' toNode='BeamSwitch' toField='whichChoice'/>
210                      < ROUTE  fromNode='CalculateAngleScript' fromField='WhichBeam' toNode='BeamSwitch2' toField='whichChoice'/>
211                 </ProtoBody>
212            </ProtoDeclare>
213            <WorldInfo info='"Authors: Mike Hunsberger" "Revised: 30 April 2001" "Purpose: Pair of TSSRs" "Browser: CosmoPlayer"title='AntennaWorld'/>
214            <ProtoInstance name='TRC170Pair'>
215                 <fieldValue name='TRC1Locationvalue='0 0 0'/>
216                 <fieldValue name='TRC2Locationvalue='-20000 0 -20000'/>
217                 <fieldValue name='OperatingModevalue='TROPOSCATTER'/>
218            </ProtoInstance>
219            <Background groundAngle='1.57079groundColor='1 0.8 0.6 0.6 0.4 0.2skyAngle='0.2skyColor='1 1 1 0.2 0.2 1'/>
220       </Scene>
221  </X3D>
<!--

<!--
Event Graph ROUTE Table shows event connections.
-->
<!-- to top Index for DEF nodes: BeamSwitch, BeamSwitch2, CalculateAngleScript, HighAbove, HighAboveXZTranslation, TransmitScript, TransmitScript2, TRC1_BEAMCONE, TRC1_BEAMCYLINDER, TRC1_TRANSFORM, TRC1_XY_TRANSFORM, TRC1Cone, TRC1Viewpoint, TRC2_BEAMCONE, TRC2_BEAMCYLINDER, TRC2_TRANSFORM, TRC2_XY_TRANSFORM, TRC2Cone, TRC2Viewpoint, TRCBody, TRCStand

Index for Viewpoint nodes: Viewpoint_1, Viewpoint_2, HighAbove, TRC1Viewpoint, TRC2Viewpoint

Index for ExternProtoDeclare definitions: BeamCone, BeamCylinder

Index for ProtoDeclare definition: TRC170Pair
-->
X3D Tooltips element index: Background, connect, ExternProtoDeclare, field, fieldValue, Group, head, Inline, IS, LOD, meta, ProtoBody, ProtoDeclare, ProtoInstance, ProtoInterface, ROUTE, Scene, Script, Switch, Transform, Viewpoint, WorldInfo, X3D, plus documentation for accessType definitions, type definitions, XML data types, and field types

Event Graph ROUTE Table entries with 20 ROUTE connections total, showing X3D event-model relationships for this scene.

Each row shows an event cascade that may occur during a single timestamp interval between frame renderings, as part of the X3D execution model.

This node has 20 outgoing ROUTEs, which is greater than $maxROUTEdepth=8
CalculateAngleScript
Script
TRC1_XZangle
SFRotation

ROUTE
event to
(1)
TRC1_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC2_XZangle
SFRotation

ROUTE
event to
(1)
TRC2_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC1_beamLength
SFFloat

ROUTE
event to
(1)
TRC1_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_beamLength
SFFloat

ROUTE
event to
(1)
TRC1_BEAMCONE
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC2_beamLength
SFFloat

ROUTE
event to
(1)
TRC2_BEAMCYLINDER
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_beamLength
SFFloat

ROUTE
event to
(1)
TRC2_BEAMCONE
ProtoInstance
range
SFFloat
CalculateAngleScript
Script
TRC1_XYangle
SFRotation

ROUTE
event to
(1)
TRC1_XY_TRANSFORM
Transform
rotation
SFRotation
CalculateAngleScript
Script
TRC2_XYangle
SFRotation

ROUTE
event to
(1)
TRC2_XY_TRANSFORM
Transform
rotation
SFRotation

TransmitScript
Script
No ROUTE connection found for output events from this node.
This Script has no direct access to other nodes. 

TransmitScript2
Script
No ROUTE connection found for output events from this node.
This Script has no direct access to other nodes. 

line 214
ProtoInstance
TRC170Pair
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

      TRC1_BEAMCONE
ProtoInstance
BeamCone
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

      TRC1_BEAMCYLINDER
ProtoInstance
BeamCylinder
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

      TRC2_BEAMCONE
ProtoInstance
BeamCone
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

      TRC2_BEAMCYLINDER
ProtoInstance
BeamCylinder
No ROUTE connection found for output events from this node.
This ProtoInstance contains SFNode/MFNode fieldValue declarations with
direct access to other nodes, and thus has potential to produce run-time animation. 

Additional guidance on X3D animation can be found in the 10-Step Animation Design Process and Event Tracing hint sheets. Have fun with X3D! 😀

-->
<!-- Online at
https://savage.nps.edu/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototypeIndex.html -->
<!-- Version control at
https://gitlab.nps.edu/Savage/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototype.x3d -->

<!-- Color-coding legend: X3D terminology <X3dNode  DEF='idNamefield='value'/> matches XML terminology <XmlElement  DEF='idNameattribute='value'/>
(Light-blue background: event-based behavior node or statement) (Grey background inside box: inserted documentation) (Magenta background: X3D Extensibility)
    <ProtoInstance name='ProtoName'> <field name='fieldName'/> </ProtoInstance> -->

to top <!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources, and X3D Scene Authoring Hints. -->