<?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>...my actionscript diary</title>
	<atom:link href="http://www.actionscriptdiary.com/diary/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.actionscriptdiary.com/diary</link>
	<description>and some other stuff at times...</description>
	<lastBuildDate>Sun, 25 Oct 2009 22:15:28 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Math.getNCube()</title>
		<link>http://www.actionscriptdiary.com/diary/index.php/2002/06/11/math-getncube/</link>
		<comments>http://www.actionscriptdiary.com/diary/index.php/2002/06/11/math-getncube/#comments</comments>
		<pubDate>Tue, 11 Jun 2002 10:05:26 +0000</pubDate>
		<dc:creator>lostchild</dc:creator>
				<category><![CDATA[AS1]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[polytope]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.actionscriptdiary.com/diary/?p=65</guid>
		<description><![CDATA[This function returns the number of components of an n-dimensional cube (known as an n-cube or measure polytope) as an array. For example If you need to know a cube&#8217;s number of components, then you would type Math.getNCube(3) and you&#8217;ll simply get the number components as the array &#8220;[8,12,6,1]&#8220;. The two examples after the code [...]]]></description>
			<content:encoded><![CDATA[<p>This function returns the number of components of an n-dimensional cube (known as an n-cube or measure polytope) as an array. For  example If you need to know a cube&#8217;s number of components, then you would type Math.getNCube(3) and you&#8217;ll simply get the number components as the array &#8220;[8,12,6,1]&#8220;. The two examples after the code should give enough information about the usage of this function.<br />
<span id="more-65"></span></p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">getNCube</span> = <span style="color: #418B65;">function</span> <span style="color: #000000;">&#40;</span>dimension<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #005CB8;">var</span> isInteger =&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>n <span style="color: #66cc66;">%</span> 1 == 0<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #005CB8;">var</span> isPositive = &nbsp; &nbsp; <span style="color: #000000;">&#40;</span>n <span style="color: #66cc66;">&gt;</span>= <span style="color: #000000;">0</span><span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #990000;">// if the argument is not a natual number</span><br />
&nbsp; &nbsp;<span style="color: #418B65;">if</span><span style="color: #000000;">&#40;</span><span style="color: #66cc66;">!</span><span style="color: #000000;">&#40;</span>isInteger <span style="color: #66cc66;">&amp;&amp;</span> isPositive<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #990000;">// quit</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #418B65;">return</span> <span style="color: #005CB8;">undefined</span><br />
&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #418B65;">else</span><span style="color: #000000;">&#123;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #990000;">// array to hold the number of components in order</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #005CB8;">var</span> element = <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; <span style="color: #418B65;">for</span><span style="color: #000000;">&#40;</span>i=<span style="color: #000000;">0</span>;i<span style="color: #66cc66;">&lt;</span>dimension+<span style="color: #000000;">1</span>;i++<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;element<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span> = <span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> ; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #418B65;">for</span><span style="color: #000000;">&#40;</span>j=<span style="color: #000000;">0</span>;j<span style="color: #66cc66;">&lt;</span>dimension+<span style="color: #000000;">1</span>;j++<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #990000;">// if the object's and its component's dimensions are equal</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #418B65;">if</span> <span style="color: #000000;">&#40;</span>i == j<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #990000;">// then the object's component is itself</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;element<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = 1 ;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #418B65;">if</span> <span style="color: #000000;">&#40;</span>i <span style="color: #66cc66;">&gt;</span> j<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #418B65;">if</span> <span style="color: #000000;">&#40;</span> j &nbsp;== 0<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = <span style="color: #005CB8;">Math</span>.<span style="color: #005CB8;">pow</span><span style="color: #000000;">&#40;</span>2,i<span style="color: #000000;">&#41;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #418B65;">if</span><span style="color: #000000;">&#40;</span> j <span style="color: #66cc66;">!</span>== 0<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; element<span style="color: #000000;">&#91;</span>i<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> = 2<span style="color: #66cc66;">*</span>element<span style="color: #000000;">&#91;</span>i-1<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j<span style="color: #000000;">&#93;</span> + element<span style="color: #000000;">&#91;</span>i-1<span style="color: #000000;">&#93;</span><span style="color: #000000;">&#91;</span>j-1<span style="color: #000000;">&#93;</span>;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<span style="color: #000000;">&#125;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; <span style="color: #000000;">&#125;</span><br />
&nbsp; &nbsp;<span style="color: #418B65;">return</span> element<span style="color: #000000;">&#91;</span>dimension<span style="color: #000000;">&#93;</span> ; &nbsp;<br />
&nbsp; &nbsp;<span style="color: #000000;">&#125;</span><br />
<span style="color: #000000;">&#125;</span></div></div>
<p>usage:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">/* get the number of components of a cube <br />
&nbsp;* returns 8,12,6,1<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">ncube</span><span style="color: #000000;">&#40;</span>3<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>;</div></div>
<p>usage:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">/* <br />
&nbsp;* define the variable &quot;hypercube&quot;<br />
&nbsp;* and assign the resulting array<br />
&nbsp;* of the Math.getNCube() method as its value<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">var</span> hypercube = <span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">getNcube</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #990000;">/* get the number of vertices of the hypercube<br />
&nbsp;* returns 16<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span>hypercube<span style="color: #000000;">&#91;</span><span style="color: #000000;">0</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #990000;">/* get the number of edges<br />
&nbsp;* returns 32<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span>hypercube<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #990000;">/* get the number of faces<br />
&nbsp;* returns 24<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span>hypercube<span style="color: #000000;">&#91;</span><span style="color: #000000;">2</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #990000;">/* get the number of cubes<br />
&nbsp;* returns 8<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span>hypercube<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span><br />
<br />
<span style="color: #990000;">/* get the number of hypercubes<br />
&nbsp;* returns 1<br />
&nbsp;* obviously itself...<br />
&nbsp;*/</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span>hypercube<span style="color: #000000;">&#91;</span><span style="color: #000000;">1</span><span style="color: #000000;">&#93;</span><span style="color: #000000;">&#41;</span></div></div>
Note: There is a rating embedded within this post, please visit this post to rate it.

<p class="sayac_bilgi"><em>This post has been read  128 times.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.actionscriptdiary.com/diary/index.php/2002/06/11/math-getncube/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math.isNatural()</title>
		<link>http://www.actionscriptdiary.com/diary/index.php/2002/06/07/math-isnatural/</link>
		<comments>http://www.actionscriptdiary.com/diary/index.php/2002/06/07/math-isnatural/#comments</comments>
		<pubDate>Fri, 07 Jun 2002 06:09:26 +0000</pubDate>
		<dc:creator>lostchild</dc:creator>
				<category><![CDATA[AS1]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.actionscriptdiary.com/diary/?p=60</guid>
		<description><![CDATA[This function simply detects if the input is a natural number. Math.isNatural = function&#40;_number&#41;&#123; &#160; &#160;var isInteger =&#160; &#160;&#40;_number % 1 == 0&#41; &#160; &#160; &#160;var isPositive = &#160; &#160; &#40;_number &#62;= 0&#41; &#160; &#160;return isInteger &#38;&#38; isPositive &#125; usage: // returns true trace&#40;Math.isNatural&#40;13&#41;&#41; // returns false trace&#40;Math.isNatural&#40;-4&#41;&#41; // returns false trace&#40;Math.isNatural&#40;Math.PI&#41;&#41; This post has [...]]]></description>
			<content:encoded><![CDATA[<p>This function simply detects if the input is a natural number.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isNatural</span> = <span style="color: #418B65;">function</span><span style="color: #000000;">&#40;</span>_number<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#123;</span> <br />
&nbsp; &nbsp;<span style="color: #005CB8;">var</span> isInteger =&nbsp; &nbsp;<span style="color: #000000;">&#40;</span>_number <span style="color: #66cc66;">%</span> 1 == 0<span style="color: #000000;">&#41;</span> &nbsp; <br />
&nbsp; &nbsp;<span style="color: #005CB8;">var</span> isPositive = &nbsp; &nbsp; <span style="color: #000000;">&#40;</span>_number <span style="color: #66cc66;">&gt;</span>= 0<span style="color: #000000;">&#41;</span><br />
&nbsp; &nbsp;<span style="color: #418B65;">return</span> isInteger <span style="color: #66cc66;">&amp;&amp;</span> isPositive<br />
<span style="color: #000000;">&#125;</span></div></div>
<p>usage:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">// returns true</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isNatural</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #990000;">// returns false</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isNatural</span><span style="color: #000000;">&#40;</span>-<span style="color: #000000;">4</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #990000;">// returns false</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isNatural</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #005CB8;">PI</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div></div>
Note: There is a rating embedded within this post, please visit this post to rate it.

<p class="sayac_bilgi"><em>This post has been read  90 times.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.actionscriptdiary.com/diary/index.php/2002/06/07/math-isnatural/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Math.isInteger()</title>
		<link>http://www.actionscriptdiary.com/diary/index.php/2002/06/06/math-isinteger/</link>
		<comments>http://www.actionscriptdiary.com/diary/index.php/2002/06/06/math-isinteger/#comments</comments>
		<pubDate>Thu, 06 Jun 2002 00:17:37 +0000</pubDate>
		<dc:creator>lostchild</dc:creator>
				<category><![CDATA[AS1]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Math]]></category>
		<category><![CDATA[prototype]]></category>

		<guid isPermaLink="false">http://www.actionscriptdiary.com/diary/?p=50</guid>
		<description><![CDATA[This function simply detects if the input is an integer. Math.isInteger = function&#40;_number&#41; &#123; &#160; &#160;return &#40;_number %1 == 0&#41;; &#125;; usage: // returns true trace&#40;Math.isInteger&#40;13&#41;&#41; // true trace&#40;Math.isInteger&#40;-3&#41;&#41; // returns false trace&#40;Math.isInteger&#40;Math.PI&#41;&#41; This post has been read 161 times.]]></description>
			<content:encoded><![CDATA[<p>This function simply detects if the input is an integer.</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isInteger</span> = <span style="color: #418B65;">function</span><span style="color: #000000;">&#40;</span>_number<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span><br />
&nbsp; &nbsp;<span style="color: #418B65;">return</span> <span style="color: #000000;">&#40;</span>_number <span style="color: #66cc66;">%</span>1 == 0<span style="color: #000000;">&#41;</span>;<br />
<span style="color: #000000;">&#125;</span>;</div></div>
<p>usage:</p>
<div class="codecolorer-container actionscript dawn" style="overflow:auto;white-space:nowrap;border: 1px solid #9F9F9F;width:435px;"><div class="actionscript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #990000;">// returns true</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isInteger</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">13</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #990000;">// true</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isInteger</span><span style="color: #000000;">&#40;</span>-<span style="color: #000000;">3</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><br />
<span style="color: #990000;">// returns false</span><br />
<span style="color: #005CB8;">trace</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #418B65;">isInteger</span><span style="color: #000000;">&#40;</span><span style="color: #005CB8;">Math</span>.<span style="color: #005CB8;">PI</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span></div></div>
Note: There is a rating embedded within this post, please visit this post to rate it.

<p class="sayac_bilgi"><em>This post has been read  161 times.</em></p>
]]></content:encoded>
			<wfw:commentRss>http://www.actionscriptdiary.com/diary/index.php/2002/06/06/math-isinteger/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

