Difference between revisions of "Robot Speed Calculator"

(Tag: 2017 source edit)
m (Replaced content with "{{SpeedCalcTemplate}} <br /> Category:Wheeled Robots Category:Tracked Robots Category:Vectoring Robots Category:Programmable Robots Category:Mechanica...")
(Tags: Replaced, Visual edit)
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
 +
{{SpeedCalcTemplate}}
  
<syntaxhighlight lang="html">
+
 
<script type="text/javascript">
+
 
// <![CDATA[
+
<br />
    $("input:enabled").change(function() {
+
[[Category:Wheeled Robots]]
            calcValues();
+
[[Category:Tracked Robots]]
        });
+
[[Category:Vectoring Robots]]
        function calcValues () {
+
[[Category:Programmable Robots]]
            var rpm = $("input[name='rpm']").val();
+
[[Category:Mechanical Engineering]]
            var ratio = $("input[name='ratio']").val();
 
            var cir = $("input[name='diameter']").val() * Math.PI;
 
            var ipm = rpm * ratio * cir;
 
            var fpm = ipm / 12.0;
 
            var mph = fpm * 60 / 5280;
 
            var mpm = fpm * 0.3048;
 
            var kph = mpm * 60 / 1000;
 
            $("input[name='circ']").val(cir.toFixed(2));
 
            $("input[name='speedIPM']").val(ipm.toFixed(2));
 
            $("input[name='speedFPM']").val(fpm.toFixed(2));
 
            $("input[name='speedMPH']").val(mph.toFixed(2));
 
            $("input[name='speedMPM']").val(mpm.toFixed(2));
 
            $("input[name='speedKPH']").val(kph.toFixed(2));
 
        }
 
        $(function() {
 
            calcValues();
 
        });
 
    // ]]>
 
    </script>
 
</syntaxhighlight>
 

Latest revision as of 13:43, 24 May 2021