<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>fs4learning &#187; Calculation of the ballistic flight parameters</title>
	<atom:link href="http://robotics.icstweb.org/fs4learning/category/projects/calculation-of-the-ballistic-flight-parameters/feed/" rel="self" type="application/rss+xml" />
	<link>http://robotics.icstweb.org/fs4learning</link>
	<description>Just another Robotics.icstweb.org weblog</description>
	<lastBuildDate>Thu, 16 Apr 2009 19:51:31 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Atmosphere module</title>
		<link>http://robotics.icstweb.org/fs4learning/2008/10/11/atmosphere-module/</link>
		<comments>http://robotics.icstweb.org/fs4learning/2008/10/11/atmosphere-module/#comments</comments>
		<pubDate>Sat, 11 Oct 2008 20:26:35 +0000</pubDate>
		<dc:creator>xni</dc:creator>
				<category><![CDATA[Calculation of the ballistic flight parameters]]></category>

		<guid isPermaLink="false">http://robotics.icstweb.org/fs4learning/?p=13</guid>
		<description><![CDATA[As an example of F# usage for calculations and demonstration of module creation I decided to publish here my code for Standard Atmosphere (atmex 3.0). You can download code or library below. (* using light syntax *) #light (* module name *) module AtmosphereLib74 &#160; (* a structure for storing atmosphere parameters *) (* * [...]]]></description>
			<content:encoded><![CDATA[<p>As an example of F# usage for calculations and demonstration of module creation I decided to publish here my code for Standard Atmosphere (atmex 3.0). You can download code or library below.</p>

<div class="wp_syntax"><div class="code"><pre class="ocaml" style="font-family:monospace;"><span style="color: #5d478b; font-style: italic;">(* using light syntax *)</span>
<span style="color: #a52a2a;">#</span>light
<span style="color: #5d478b; font-style: italic;">(* module name *)</span>
<span style="color: #06c; font-weight: bold;">module</span> AtmosphereLib74
&nbsp;
<span style="color: #5d478b; font-style: italic;">(* a structure for storing atmosphere parameters *)</span>
<span style="color: #5d478b; font-style: italic;">(*
 *  Of course, I could use tuple float * float * float * float,
 *  but at http://blogs.msdn.com/jomo_fisher/archive/2008/09/16/f-performance-tweaking.aspx
 *  I read, what returning structures insted of tuples is more efficient
 *)</span>
<span style="color: #06c; font-weight: bold;">type</span> AtmosphereParameters <span style="color: #a52a2a;">=</span>
    <span style="color: #06c; font-weight: bold;">struct</span>
        <span style="color: #06c; font-weight: bold;">val</span> height <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span>
        <span style="color: #06c; font-weight: bold;">val</span> pressure <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span>
        <span style="color: #06c; font-weight: bold;">val</span> density <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span>
        <span style="color: #06c; font-weight: bold;">val</span> temperature <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span>
        <span style="color: #06c; font-weight: bold;">val</span> sonic <span style="color: #a52a2a;">:</span> <span style="color: #06c; font-weight: bold;">float</span>
        <span style="color: #06c; font-weight: bold;">new</span> <span style="color: #6c6;">&#40;</span>h,p,d,t,s<span style="color: #6c6;">&#41;</span> <span style="color: #a52a2a;">=</span> <span style="color: #6c6;">&#123;</span>height<span style="color: #a52a2a;">=</span>h<span style="color: #a52a2a;">;</span> pressure<span style="color: #a52a2a;">=</span>p<span style="color: #a52a2a;">;</span> density<span style="color: #a52a2a;">=</span>d<span style="color: #a52a2a;">;</span> temperature<span style="color: #a52a2a;">=</span>t<span style="color: #a52a2a;">;</span> sonic<span style="color: #a52a2a;">=</span>s<span style="color: #6c6;">&#125;</span>
    <span style="color: #06c; font-weight: bold;">end</span>
&nbsp;
<span style="color: #06c; font-weight: bold;">let</span> getAtmosphere h <span style="color: #a52a2a;">=</span>
    <span style="color: #5d478b; font-style: italic;">(*
     calculations of pressure, density, temp, sonic
    *)</span>
    <span style="color: #5d478b; font-style: italic;">(* and here I create and return a structure *)</span>
    AtmosphereParameters<span style="color: #6c6;">&#40;</span>h,pressure,density,temp,sonic<span style="color: #6c6;">&#41;</span></pre></div></div>

<p>You can download this example as a <a href="http://robotics.icstweb.org/uploads/users/xni/projects/2008-10-Atmosphere/AtmosphereModuleSrc.zip">code</a> or as a compiled <a href="http://robotics.icstweb.org/uploads/users/xni/projects/2008-10-Atmosphere/AtmosphereModuleLib.zip">library</a>.</p>
<p>To use any kind of libraries you should just add reference to it into your project and use it&#8217;s namespace.</p>
 <img src="http://robotics.icstweb.org/fs4learning/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=13" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://robotics.icstweb.org/fs4learning/2008/10/11/atmosphere-module/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
