<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>http://wiki.newmars.com/index.php?action=history&amp;feed=atom&amp;title=Hohmann_in_Visual_Basic</id>
		<title>Hohmann in Visual Basic - Revision history</title>
		<link rel="self" type="application/atom+xml" href="http://wiki.newmars.com/index.php?action=history&amp;feed=atom&amp;title=Hohmann_in_Visual_Basic"/>
		<link rel="alternate" type="text/html" href="http://wiki.newmars.com/index.php?title=Hohmann_in_Visual_Basic&amp;action=history"/>
		<updated>2026-05-23T03:52:33Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.29.1</generator>

	<entry>
		<id>http://wiki.newmars.com/index.php?title=Hohmann_in_Visual_Basic&amp;diff=195&amp;oldid=prev</id>
		<title>Josh Cryer: 1 revision</title>
		<link rel="alternate" type="text/html" href="http://wiki.newmars.com/index.php?title=Hohmann_in_Visual_Basic&amp;diff=195&amp;oldid=prev"/>
				<updated>2009-01-21T11:02:28Z</updated>
		
		<summary type="html">&lt;p&gt;1 revision&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&#039;vertical-align: top;&#039; lang=&#039;en&#039;&gt;
				&lt;td colspan=&#039;1&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&#039;1&#039; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 11:02, 21 January 2009&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&#039;2&#039; style=&#039;text-align: center;&#039; lang=&#039;en&#039;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(No difference)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
		<author><name>Josh Cryer</name></author>	</entry>

	<entry>
		<id>http://wiki.newmars.com/index.php?title=Hohmann_in_Visual_Basic&amp;diff=194&amp;oldid=prev</id>
		<title>Rxke at 20:21, 17 August 2005</title>
		<link rel="alternate" type="text/html" href="http://wiki.newmars.com/index.php?title=Hohmann_in_Visual_Basic&amp;diff=194&amp;oldid=prev"/>
				<updated>2005-08-17T20:21:47Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Intro==&lt;br /&gt;
[[Visual Basic]] is a Microsoft product which is promoted by Microsoft as one of the easier programming languages. The advantage of using visual basic is since it is a Microsoft product it is easy to use to communicate with many Microsoft applications including, Microsoft Word, Microsoft Excel and Microsoft Access. &lt;br /&gt;
&lt;br /&gt;
Also a wide number of people already have the tools to use it since Microsoft freely builds a visual basic macro editor into Microsoft office software. Thus for many people that are comfortable using spreadsheets to do computation visual basic provides an “easy” means of extending the power of those spread sheets.&lt;br /&gt;
&lt;br /&gt;
People generally associate visual basic with graphical programming. However, visual programming can be done in most languages with the right integrated development environment. For instance in JAVA there is JBuilder, and for C there is visual C++ and lab windows. Thus because you can program graphically in visual basic does not mean that the language is any easier. Moreover, it is much more difficult to generalize code in a graphical program environment. Hence, graphical programming is a less flexible way to build [[GUI]]s.&lt;br /&gt;
&lt;br /&gt;
Another supposed advantage of visual basic is that the simplicity of the syntax. “Visual Basic is built on basic, which is the simplest programming language ever devised.” Such marketing sound bites are outright falsehoods. The syntax of the visual basic language is no simpler then any other language derived from the syntax of [[BCPL]] family. Most peoplar languages are based on the BCPL family.&lt;br /&gt;
&lt;br /&gt;
Another problem with visual basic is that the code is difficult to generalize. For instance array functions and access calls do not work on scalar variables. Moreover, arrays must be addressed with the proper number of indices. Thus although visual basic has a variant datatype it’s is only a marginal improvement over fixed datatypes and not well suited for generic programming.&lt;br /&gt;
==Visual Basic Code to calculate the period of a transfer orbit==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A simple function using the variant data type&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 Function y=Hohmann_P(r1, r2, mu) &lt;br /&gt;
     if nargin&amp;lt;3; mu=6.672E-11; % (N m^2 Kg^-2) &lt;br /&gt;
    y = Sqrt(mu / r1) * Sqrt(2 * r2 / (r1 + r2) - 1); &lt;br /&gt;
 End Function&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A more complicated example illustrating how datatypes can be translated in visual basic&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
This example also shows how to get values from spread sheets. It was not necessary to transform the numbers into double and the Hohmann function above could be used instead to calculate the period with this same test function. However, the example was done this way to explicitly show how to convert between datatypes should the author need to. Clearly this lengths the code and the situation becomes more difficult with multidimensional data types. A better way to handle matrix and vector quantities is with an environment like [[MATLAB]] or [[Octave]].&lt;br /&gt;
&lt;br /&gt;
 Sub Hohmann_test() &lt;br /&gt;
      Dim AU As Range &lt;br /&gt;
      Dim G As Range &lt;br /&gt;
      Dim r1 As Range &lt;br /&gt;
      Dim r2 As Range &lt;br /&gt;
      Dim answer As Double &lt;br /&gt;
      Set AU = Worksheets(&amp;quot;Sheet1&amp;quot;).Range(&amp;quot;B1&amp;quot;) &lt;br /&gt;
      Set G = Worksheets(&amp;quot;Sheet1&amp;quot;).Range(&amp;quot;B2&amp;quot;) &lt;br /&gt;
      Set r1 = Worksheets(&amp;quot;Sheet1&amp;quot;).Range(&amp;quot;B3&amp;quot;) &lt;br /&gt;
      Set r2 = Worksheets(&amp;quot;Sheet1&amp;quot;).Range(&amp;quot;B4&amp;quot;) &lt;br /&gt;
      answer = Hohmann_P(r1 * AU, r2 * AU, G) &lt;br /&gt;
 End Sub &lt;br /&gt;
 Function Hohmann_P(r1_a, r2_a, mu_a) &lt;br /&gt;
      Dim r1 As Double &lt;br /&gt;
      Dim r2 As Double &lt;br /&gt;
      Dim mu As Double &lt;br /&gt;
      r1 = DblFrmRange(r1_a) &lt;br /&gt;
      r2 = DblFrmRange(r2_a) &lt;br /&gt;
      mu = DblFrmRange(mu_a) &lt;br /&gt;
      Hohmann_P = Sqr(mu / r1) * Sqr(2 * r2 / (r1 + r2) - 1) &lt;br /&gt;
 End Function &lt;br /&gt;
 Function DblFrmRange(a) As Double &lt;br /&gt;
      If StrComp(TypeName(a), &amp;quot;Range&amp;quot;) Eqv 0 Then &lt;br /&gt;
            DblFrmRange = CDbl(a.Value2) &lt;br /&gt;
      Else &lt;br /&gt;
           DblFrmRange = CDbl(a) &lt;br /&gt;
      End If &lt;br /&gt;
 End Function&lt;/div&gt;</summary>
		<author><name>Rxke</name></author>	</entry>

	</feed>