• Electricity
    • Waterfall >
      • Pumped Storage >
        • Hydro Electricity
        • Pumped Storage Online Research
    • Virtual Laboratory
    • Electricity Lecture
  • Analog DC Circuits
    • Simple Ohms Law Demo
    • Ammeter Troubleshooting >
      • GLM P36 & P37 >
        • GLM P38 & P39
        • GLM P40 & P41
        • GLM P42 & P43
        • GLM P44 & P45
    • Bridge Circuit
    • Power and the Wattmeter >
      • DC Online Free Tutorials
      • GLM Page 29
      • GLM Page 30
      • GLM Page 31
    • Series Circuit Simulation #1 >
      • Series Circuit Sim #2
      • Series Circuit Sim #3
      • Series Circuit Sim #4
    • HVDC Power Transmission
    • DC LECTURE
  • Analog AC Circuits
    • Simple AC Circuits Demonstrations
    • AC Filter Troubleshooting
    • Transformer
    • AC Lecture
    • AC Online Free Tutorials
  • Digital Electronics
    • Four Bit Adder >
      • GLM P232 & 233 >
        • GLMP234 & 235
        • GLM P236 & 237
        • GLM P239 & 240
        • Slider Test Page #1
    • Four Bit Comparator >
      • Comparator Failure 1
      • Comparator Failure 2
    • Digital Online Tutorials and eBooks
    • Digital Electronics Lecture
  • Transistor Circuits
    • Transistor Operation
    • Voltage Regulator
    • Amplifier 3 Stage >
      • Transistor Amp Fault 1 Slideshow
    • Transistor Online Tutorials and eBooks
    • Transistor Lecture
  • Computers
    • Instruction Set, Microprocessor Specifications, and Schematic
    • Control Panel
    • Step by Step Tutorial
    • Programmable Memory
    • Computers Online Tutorials and eBooks
  • Computer Interface
    • Interface schematic
    • Drawing Notes
    • InterfaceFault1
    • InterfaceFault2
    • InterfaceFault3
    • InterfaceFault4
    • InterfaceFault5
    • Cyber Attack
  • Physics
    • About Newton's Laws >
      • Physics (Newton's Laws) >
        • Flatspace >
          • Flat space source code (script)
          • Flat-space with Target >
            • Flat-space with Target - Source Code
            • Target Closing Velocity #1
            • Target Closing Velocity #2
        • Gravity >
          • Earth Gravity
          • Gravity Source Code
        • Gravity + Track
        • Orbit Earth Equator
        • Earth Orbit Easy
        • Pluto Orbit >
          • Pluto Source Code
    • Deep Space North >
      • Escape Velocity
      • Radar Display
      • Intercept #1
      • Intercept #2
      • Intercept #3
      • Intercept #4
    • Physics (Heat Engine) >
      • Heat Engine
      • Heat Engine JavaScript
    • Physics Online Resources
    • Free College Links
  • JavaScript (JS)
    • The Math Object >
      • Resistors in Parallel
    • Simple Form Gui >
      • Button Form
    • Series Circuit (JS)
    • JavaSource Downloads >
      • Bouncing Ball
    • JaveScript Lessons >
      • Lesson #1
      • Lesson #2
      • Lesson #3
      • Lesson #4
  • Site Map
    • Site Map Level 2 >
      • Site Map Level 3
  • Our Product
    • Text Files Online
  • WEB Development
    • Google Drive
    • Dreamweaver
    • Internet Security
  • About
    • Electronics Course >
      • FREE TEXT EBOOKS >
        • Free Online Colleges
      • Already got a book?
    • Universal Software Development Platform
    • Best Tutorial per hour of study.
    • Shortcut to a Career Path
  • Teachers Only
    • Circuit Troubleshooting
    • JS for Technical Students
    • Physics and Math
Electronics Circuit Simulator and Physics Virtual Laboratory.









Flatspace Source Code

Newtons Laws of motion in a Cartesian coordinate system.

Physics Newtons Laws
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Flatspace</title>
<Script Language = "JavaScript" >
  var prom = new Array(80);
  Xposition = 0 ;Yposition = 0 ;Yvel = 0, Xvel = 0; AngleF = 0, AngleSpeed = 0; Speed = 0;
   Yacc = 0; Xacc = 0; Degree = Math.PI/180;Fval = 1;Time = 0;Courseval = 0;k =1; Xold = 0; Yold = 0;TargetX = 100000;RangeP2=100;Range = 10;
TargetY = 200000; Xrange = 1000; Yrange = 1000;Radardegree = .001;

   function Target(){Xrange = TargetX - Xposition ;Yrange = TargetY - Yposition;RangeP2 = Xrange*Xrange + Yrange*Yrange;Range= Math.sqrt(RangeP2);
Radardegree = Math.atan(Yrange/Xrange);Radardegree = (180/ Math.PI) * Radardegree; RangeP2 = parseInt(RangeP2);Radardegree = parseInt(Radardegree);
 alert("  Range = " + Range + "km   " + " Azimuth = " + Radardegree + " degrees  " + "RangeX = " + Xrange + "   RangeY=" + Yrange ) }

  
  function Clear(){Xposition = 0 ;Yposition = 0 ;Yvel = 0; Xvel = 0; AngleF = 0, AngleSpeed = 0; Speed = 0;
   Yacc = 0; Xacc = 0;k = 1; Degree = Math.PI/180;Fval = 1;Time = 0;Courseval = 0;k = 1;Xold = 0;Yold = 0;TargetX = 100000;RangeP2=100;Range = 10;
TargetY = 200000; Xrange = 1000; Yrange = 1000;Radardegree = .001 }

  function Enter(){k = document.F1.T2.value;k = parseInt(k)*60;AngleF = document.F1.T1.value;AngleF = parseInt(AngleF)}
  function Velocity(){Yacc = Fval* Math.sin(AngleF*Degree); Yvel = Yvel + Yacc; Yposition = Yposition + (Yvel + Yold)/2;Yold = Yvel; TargetX = TargetX + 2; TargetY = TargetY+ .3;
  Xacc = Fval* Math.cos(AngleF*Degree); Xvel = Xvel + Xacc; Xposition = Xposition + (Xvel + Xold)/2; Xold = Xvel; Speed = (Yvel*Yvel) + (Xvel*Xvel); Speed = Math.sqrt(Speed); Time = Time + (1/1000);
  Courseval =Math.atan(Yvel/Xvel);Courseval = (180/ Math.PI) * Courseval;if (Xvel < 0) {Courseval = Courseval + 180}}
  function Looper(){for (i = 0;i<k;i++){Velocity()}}
</script>
  
  

</head>


<body background="_themes/blends/blegtext.gif" bgcolor="#CCCCCC" text="#000000" link="#993300" vlink="#0000FF" alink="#FF9900"><!--mstheme--><font face="Trebuchet MS, Arial, Helvetica"><p align="center"><font face="Arial Black">Force and Acceleration<br>
</font><font face="Arial">(a Newton's Law physics educational game)</font>
</p>
<p align="left"><br>
<b><font face="Arial" size="3">Acceleration:</font><font face="Arial" size="4">&nbsp;</font></b><font face="Arial" size="3">This
simulation allows you to move about&nbsp; a flat ( 2 dimensional, gravity free)</font><b><font face="Arial" size="4">&nbsp;</font></b><font face="Arial" size="3">space
in a ion propelled imaginary space ship.&nbsp; Type in the ship orientation (
force direction) and thrust duration (time, s = .5*a *t^2), and then click ENTER
... button.&nbsp; This enters desired course and duration into space ship ion
propulsion engine control computer. The computer uses the accelerometer sensor
inputs to regulate thrust so as to maintain desired acceleration.&nbsp; Engine
burn does not begin and <b>Time</b> does not change until an <b>Engine Control
Button</b> is clicked. The <b>STOP ENGINE</b> button advances time by an amount
specified (Thrust Duration as entered) at zero acceleration.&nbsp;&nbsp;</font>
</p>
<p align="left"><font face="Arial" size="3">Start by moving along a single axis
at slow speed and note how far you travel in an hour.&nbsp; Though .1 meters per
second per second is less than 1/100 of a earth &quot;g&quot; it is still far greater than what
ion propulsion engine spacecraft can achieve today, but even 1 meter per second
squared may be obtained in the future.&nbsp; Trip starts at X, Y coordinate
0,0.  Ignore the target message until you have traveled through of four quadrants of the cartesian coodinate system. Travel through all four quadrants clockwise
 and counter clockwise.  Next, Click "Reset" and start playing the intercept target game.  Try to get close to target without overshooting it.&nbsp;&nbsp;&nbsp;</font></p>
<p align="center"><font face="Arial Black" color="#FF0000">Space Ship
Engineering Control Panel</font></p>
<form  NAME="F1" action="_derived/nortbots.htm" method="POST" onSubmit="location.href='_derived/nortbots.htm';return false;" webbot-action="--WEBBOT-SELF--" WEBBOT-onSubmit ><!--webbot
  bot="SaveResults" startspan --><strong>[Engineering Control Panel]</strong><!--webbot
  bot="SaveResults" endspan i-checksum="6561" --><p align="left">&nbsp; 
   <input name="T1" size="21">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input name="T2" size="19">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <br>
  &nbsp; Enter Ship Orientation(0 - 360 degrees)&nbsp;&nbsp;&nbsp; Enter Thrust
  Duration (Integer 1- 1200 minutes) </p>
  <p align="center"><input type = "button"  value = "ENTER SHIP ORIENTATION AND ENGINE BURN DURATION" name="B5"
   onClick = "Enter();Target();document.F1.T2.value = k/60;document.F1.T1.value = AngleF" ;> </p>  
  <p align="left"><font face="Arial"><b>Speed </b>(km/sec)</font>
  <input name="T3" size="25">&nbsp;&nbsp;&nbsp;&nbsp;<font face="Arial Black">
  </font><font face="Arial">
  <b>Course </b>(degrees)</font><input name="T4" size="25"> </p>
  <p align="left"><font face="Arial"><font size="4"><b>X </b>(in km)</font><b> =
  <input name="T5" size="27">, </b></font><b><font face="Arial" size="4">Y</font></b><font size="4" face="Arial"><b>
  </b>(in km)</font><b><font face="Arial" size="4"> =&nbsp; <input name="T6" size="27"></font><font face="Arial">&nbsp;</font></b> </p>
  <p align="left">&nbsp;<font face="Arial Black">Time (in kilo-seconds)</font>&nbsp;&nbsp;<input name="T7" size="27"> </p>
  <p align="left"><font face="Arial Black"><u>Engine Control Buttons Below:</u></font> </p>
  <p align="left"><input type = "button"  value="STOP ENGINE" name="B4"
  onClick = "Fval = 0,Looper();document.F1.T3.value = Speed;document.F1.T6.value = Yposition;document.F1.T5.value = Xposition;
   document.F1.T7.value = Time; document.F1.T4.value = Courseval;">
  
   <input type = "button" value = "SLOW (.1 M/S/S)" name="B6"   onClick = "Fval = .0001;
   Looper();document.F1.T3.value = Speed;document.F1.T6.value = Yposition;document.F1.T5.value = Xposition;
   document.F1.T7.value = Time; document.F1.T4.value = Courseval;  " >
   
   <input type = "button" value="Full Speed Adead (1 M/S/S)" name="B7" onClick="Fval = .001;
   Looper();document.F1.T3.value = Speed;document.F1.T6.value = Yposition;document.F1.T5.value = Xposition;
   document.F1.T7.value = Time; document.F1.T4.value = Courseval;  "></p>
   
  <p align="center">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
  <input type = "button"  value ="Reset" name="B8" onClick = "Clear();document.F1.T3.value = 0;document.F1.T6.value = Yposition;document.F1.T5.value = Xposition;
   document.F1.T7.value = Time; document.F1.T4.value = Courseval;  "> <font face="Arial" size="2">Reenter
  course and burn duration after <b>Reset</b></font></p>
  
</form>
<p align="left"><font face="Arial"><b>Note: Ship Orientation </b>and<b> Course</b>
are independent of each other.</font>
</p>
<p align="left"><font face="Arial">Exercise: Travel to X = 1000km + or - 1.0km&nbsp; and Y = 1000km +
or - 1.0 km and stop there ( slowing to a velocity less than 10 meters per second
constitutes a stop.)</font><br>


</html>
Copy script above and create your own HTML version of FLAT SPACE  JavaScribt.

Modify " function Target " so that azimuth reads correctly when Xrange is negative.  That is when spaceship X position exceeds Target X position.  Frequently we see that in the real world space  probes require  software updates after launch and must be transmitted to space probe.




Web Hosting by Networks