<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<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'>
  <head>
    <meta content='TRC170PairPrototype.x3d' name='title'/>
    <meta content='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 (&lt; 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 ( &lt; 50 miles).' name='description'/>
    <meta content='Mike Hunsberger' name='creator'/>
    <meta content='8 May 2001' name='created'/>
    <meta content='12 October 2023' name='modified'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170PairPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 4.0, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <ExternProtoDeclare appinfo='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).' name='BeamCylinder' url='"../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.x3d#BeamCylinder" "../../CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamCylinderPrototype.wrl#BeamCylinder"'>
      <field accessType='inputOnly' appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?' name='contact' type='SFBool'/>
      <field accessType='inputOnly' appinfo='distance in meters along x axis' name='range' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='distance in meters used until eventIn range sent' name='defaultRange' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='whether wireframe beam is drawn' name='wireframe' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='whether solid beam is drawn' name='solid' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='meters across vertical y axis' name='beamHeight' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='meters across horizontal z axis' name='beamWidth' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=true' name='contactColor' type='SFColor'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=false' name='noContactColor' type='SFColor'/>
      <field accessType='inputOutput' appinfo='1 = fully transparent wireframe only' name='transparency' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='Assigning a name to a BeamCylinder aids tracing' name='name' type='SFString'/>
    </ExternProtoDeclare>
    <ExternProtoDeclare appinfo='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).' name='BeamCone' url='"../../CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "../../CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone"'>
      <field accessType='inputOnly' appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?' name='contact' type='SFBool'/>
      <field accessType='inputOnly' appinfo='distance in meters along x axis' name='range' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='distance in meters used until eventIn range sent' name='defaultRange' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='whether wireframe beam is drawn' name='wireframe' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='whether solid beam is drawn' name='solid' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='degrees across vertical y axis' name='beamHeightDegrees' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='degrees across horizontal z axis' name='beamWidthDegrees' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=true' name='contactColor' type='SFColor'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=false' name='noContactColor' type='SFColor'/>
      <field accessType='inputOutput' appinfo='1 = fully transparent wireframe only' name='transparency' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='BeamCone name aids in node identification and tracing' name='name' type='SFString'/>
      <field accessType='initializeOnly' appinfo='flag to turn on Script tracing' name='traceEnabled' type='SFBool'/>
    </ExternProtoDeclare>
    <!-- ExternProtoDeclare definitions must be included verbatim -->
    <!-- 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. -->
    <ProtoDeclare name='TRC170Pair'>
      <ProtoInterface>
        <field accessType='initializeOnly' name='TRC1Location' type='SFVec3f' value='1 1 1'/>
        <field accessType='initializeOnly' name='TRC2Location' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='OperatingMode' type='SFString' value='DIRECT'/>
      </ProtoInterface>
      <ProtoBody>
        <Group>
          <Transform DEF='HighAboveXZTranslation'>
            <Viewpoint DEF='HighAbove' description='High Above TRC170' orientation='1 0 0 -1.4' position='0 0 0'/>
          </Transform>
          <Viewpoint DEF='TRC1Viewpoint' description='TRC170 #1'/>
          <Viewpoint DEF='TRC2Viewpoint' description='TRC170 #2'/>
          <LOD range='200000'>
            <!-- 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. -->
            <Transform DEF='TRC1_TRANSFORM' translation='-2 0 0'>
              <IS>
                <connect nodeField='translation' protoField='TRC1Location'/>
              </IS>
              <Transform DEF='TRC1_XY_TRANSFORM' translation='1 5 0'>
                <Inline DEF='TRCBody' url='"TRC170Dish.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.x3d" "TRC170Dish.wrl" "../../CommunicationsAndSensors/TRC170/TRC170Dish.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Dish.wrl"'/>
                <Transform DEF='TRC1Cone' translation='2 0 0'>
                  <Switch DEF='BeamSwitch' whichChoice='0'>
                    <Group>
                      <ProtoInstance DEF='TRC1_BEAMCYLINDER' name='BeamCylinder'>
                        <fieldValue name='defaultRange' value='10'/>
                        <fieldValue name='beamHeight' value='1.5'/>
                        <fieldValue name='beamWidth' value='1.5'/>
                        <fieldValue name='transparency' value='0.2'/>
                        <fieldValue name='wireframe' value='true'/>
                        <fieldValue name='solid' value='true'/>
                        <fieldValue name='contactColor' value='.3 .5 .5'/>
                        <fieldValue name='noContactColor' value='.8 .1 .1'/>
                      </ProtoInstance>
                    </Group>
                    <Group>
                      <ProtoInstance DEF='TRC1_BEAMCONE' name='BeamCone'>
                        <fieldValue name='defaultRange' value='10'/>
                        <fieldValue name='beamHeightDegrees' value='2'/>
                        <fieldValue name='beamWidthDegrees' value='2'/>
                        <fieldValue name='transparency' value='0.2'/>
                        <fieldValue name='wireframe' value='true'/>
                        <fieldValue name='solid' value='true'/>
                        <fieldValue name='noContactColor' value='.8 .1 .1'/>
                        <fieldValue name='contactColor' value='.3 .5 .5'/>
                      </ProtoInstance>
                    </Group>
                  </Switch>
                </Transform>
              </Transform>
              <Transform>
                <Inline DEF='TRCStand' url='"TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.x3d" "../../CommunicationsAndSensors/TRC170/TRC170Tripod.wrl" "TRC170Tripod.wrl" "https://www.web3d.org/x3d/content/examples/Savage/CommunicationsAndSensors/TRC170/TRC170Tripod.wrl"'/>
                <LOD range='500'>
                  <Viewpoint description='TRC170 Side View' position='0 5 40'/>
                  <WorldInfo info='"null node for no rendering when distant"'/>
                </LOD>
              </Transform>
            </Transform>
            <WorldInfo info='"null node for no rendering when distant"'/>
          </LOD>
          <LOD range='200000'>
            <!-- 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. -->
            <Transform DEF='TRC2_TRANSFORM' translation='-2 0 0'>
              <IS>
                <connect nodeField='translation' protoField='TRC2Location'/>
              </IS>
              <Transform DEF='TRC2_XY_TRANSFORM' translation='1 5 0'>
                <Inline USE='TRCBody'/>
                <Transform DEF='TRC2Cone' translation='2 0 0'>
                  <Switch DEF='BeamSwitch2' whichChoice='0'>
                    <Group>
                      <ProtoInstance DEF='TRC2_BEAMCYLINDER' name='BeamCylinder'>
                        <fieldValue name='defaultRange' value='10'/>
                        <fieldValue name='beamHeight' value='1.5'/>
                        <fieldValue name='beamWidth' value='1.5'/>
                        <fieldValue name='transparency' value='0.2'/>
                        <fieldValue name='wireframe' value='true'/>
                        <fieldValue name='solid' value='true'/>
                        <fieldValue name='contactColor' value='.3 .5 .5'/>
                        <fieldValue name='noContactColor' value='.8 .1 .1'/>
                      </ProtoInstance>
                    </Group>
                    <Group>
                      <ProtoInstance DEF='TRC2_BEAMCONE' name='BeamCone'>
                        <fieldValue name='defaultRange' value='10'/>
                        <fieldValue name='beamHeightDegrees' value='2'/>
                        <fieldValue name='beamWidthDegrees' value='2'/>
                        <fieldValue name='transparency' value='0.2'/>
                        <fieldValue name='wireframe' value='true'/>
                        <fieldValue name='solid' value='true'/>
                        <fieldValue name='noContactColor' value='.8 .1 .1'/>
                        <fieldValue name='contactColor' value='.3 .5 .5'/>
                      </ProtoInstance>
                    </Group>
                  </Switch>
                </Transform>
              </Transform>
              <Transform>
                <Inline USE='TRCStand'/>
                <LOD range='500'>
                  <Transform>
                    <Viewpoint description='TRC170 Side View' position='0 5 40'/>
                  </Transform>
                  <Transform/>
                </LOD>
              </Transform>
            </Transform>
            <WorldInfo info='"null node"'/>
          </LOD>
          <Script DEF='TransmitScript'>
            <field accessType='inputOnly' name='transState' type='SFInt32'/>
            <field accessType='outputOnly' name='size' type='SFVec3f'/>
            <![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);
}
]]>
          </Script>
          <Script DEF='TransmitScript2'>
            <field accessType='inputOnly' name='transState' type='SFInt32'/>
            <field accessType='outputOnly' name='size' type='SFVec3f'/>
            <![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);
}
]]>
          </Script>
          <!-- This script is used to calculate the corresponding rotation angles so the TSSRs will be pointed at each other -->
          <Script DEF='CalculateAngleScript'>
            <field accessType='initializeOnly' name='TRC1Location' type='SFVec3f'/>
            <field accessType='initializeOnly' name='TRC2Location' type='SFVec3f'/>
            <field accessType='initializeOnly' name='OperatingMode' type='SFString'/>
            <field accessType='outputOnly' name='TRC1_XZangle' type='SFRotation'/>
            <field accessType='outputOnly' name='TRC2_XZangle' type='SFRotation'/>
            <field accessType='outputOnly' name='beamScale' type='SFVec3f'/>
            <field accessType='outputOnly' name='TRC1_beamLength' type='SFFloat'/>
            <field accessType='outputOnly' name='TRC2_beamLength' type='SFFloat'/>
            <field accessType='outputOnly' name='TRC1_XYangle' type='SFRotation'/>
            <field accessType='outputOnly' name='TRC2_XYangle' type='SFRotation'/>
            <field accessType='outputOnly' name='LinkEstablished' type='SFBool'/>
            <field accessType='outputOnly' name='TRC1_Viewpoint' type='SFVec3f'/>
            <field accessType='outputOnly' name='TRC2_Viewpoint' type='SFVec3f'/>
            <field accessType='outputOnly' name='TRC1_ViewpointAngle' type='SFRotation'/>
            <field accessType='outputOnly' name='TRC2_ViewpointAngle' type='SFRotation'/>
            <field accessType='outputOnly' name='HighAboveViewpoint' type='SFVec3f'/>
            <field accessType='outputOnly' name='HighAboveTranslationAngle' type='SFRotation'/>
            <field accessType='outputOnly' name='WhichBeam' type='SFInt32'/>
            <IS>
              <connect nodeField='TRC1Location' protoField='TRC1Location'/>
              <connect nodeField='TRC2Location' protoField='TRC2Location'/>
              <connect nodeField='OperatingMode' protoField='OperatingMode'/>
            </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]);
}
]]>
          </Script>
        </Group>
        <ROUTE fromField='TRC1_XZangle' fromNode='CalculateAngleScript' toField='rotation' toNode='TRC1_TRANSFORM'/>
        <ROUTE fromField='TRC2_XZangle' fromNode='CalculateAngleScript' toField='rotation' toNode='TRC2_TRANSFORM'/>
        <ROUTE fromField='TRC1_beamLength' fromNode='CalculateAngleScript' toField='range' toNode='TRC1_BEAMCYLINDER'/>
        <ROUTE fromField='TRC1_beamLength' fromNode='CalculateAngleScript' toField='range' toNode='TRC1_BEAMCONE'/>
        <ROUTE fromField='TRC2_beamLength' fromNode='CalculateAngleScript' toField='range' toNode='TRC2_BEAMCYLINDER'/>
        <ROUTE fromField='TRC1_beamLength' fromNode='CalculateAngleScript' toField='range' toNode='TRC2_BEAMCONE'/>
        <ROUTE fromField='TRC1_XYangle' fromNode='CalculateAngleScript' toField='rotation' toNode='TRC1_XY_TRANSFORM'/>
        <ROUTE fromField='TRC2_XYangle' fromNode='CalculateAngleScript' toField='rotation' toNode='TRC2_XY_TRANSFORM'/>
        <ROUTE fromField='LinkEstablished' fromNode='CalculateAngleScript' toField='contact' toNode='TRC1_BEAMCYLINDER'/>
        <ROUTE fromField='LinkEstablished' fromNode='CalculateAngleScript' toField='contact' toNode='TRC1_BEAMCONE'/>
        <ROUTE fromField='LinkEstablished' fromNode='CalculateAngleScript' toField='contact' toNode='TRC2_BEAMCYLINDER'/>
        <ROUTE fromField='LinkEstablished' fromNode='CalculateAngleScript' toField='contact' toNode='TRC2_BEAMCONE'/>
        <ROUTE fromField='TRC1_Viewpoint' fromNode='CalculateAngleScript' toField='position' toNode='TRC1Viewpoint'/>
        <ROUTE fromField='TRC2_Viewpoint' fromNode='CalculateAngleScript' toField='position' toNode='TRC2Viewpoint'/>
        <ROUTE fromField='TRC1_ViewpointAngle' fromNode='CalculateAngleScript' toField='orientation' toNode='TRC1Viewpoint'/>
        <ROUTE fromField='TRC2_ViewpointAngle' fromNode='CalculateAngleScript' toField='orientation' toNode='TRC2Viewpoint'/>
        <ROUTE fromField='HighAboveViewpoint' fromNode='CalculateAngleScript' toField='translation' toNode='HighAboveXZTranslation'/>
        <ROUTE fromField='HighAboveTranslationAngle' fromNode='CalculateAngleScript' toField='rotation' toNode='HighAboveXZTranslation'/>
        <ROUTE fromField='WhichBeam' fromNode='CalculateAngleScript' toField='whichChoice' toNode='BeamSwitch'/>
        <ROUTE fromField='WhichBeam' fromNode='CalculateAngleScript' toField='whichChoice' toNode='BeamSwitch2'/>
      </ProtoBody>
    </ProtoDeclare>
    <WorldInfo info='"Authors: Mike Hunsberger" "Revised: 30 April 2001" "Purpose: Pair of TSSRs" "Browser: CosmoPlayer"' title='AntennaWorld'/>
    <ProtoInstance name='TRC170Pair'>
      <fieldValue name='TRC1Location' value='0 0 0'/>
      <fieldValue name='TRC2Location' value='-20000 0 -20000'/>
      <fieldValue name='OperatingMode' value='TROPOSCATTER'/>
    </ProtoInstance>
    <Background groundAngle='1.57079' groundColor='1 0.8 0.6 0.6 0.4 0.2' skyAngle='0.2' skyColor='1 1 1 0.2 0.2 1'/>
  </Scene>
</X3D>