<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3AArrays.inc</id>
	<title>Reference:Arrays.inc - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.povray.org/content?action=history&amp;feed=atom&amp;title=Reference%3AArrays.inc"/>
	<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Arrays.inc&amp;action=history"/>
	<updated>2026-04-27T17:56:43Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Arrays.inc&amp;diff=6758&amp;oldid=prev</id>
		<title>Jholsenback: 1 revision: Reference Migration Initial Load</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Arrays.inc&amp;diff=6758&amp;oldid=prev"/>
		<updated>2012-03-15T19:05:04Z</updated>

		<summary type="html">&lt;p&gt;1 revision: Reference Migration Initial Load&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left diff-editfont-monospace&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 19:05, 15 March 2012&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-notice&quot; lang=&quot;en&quot;&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>Jholsenback</name></author>
	</entry>
	<entry>
		<id>https://wiki.povray.org/content?title=Reference:Arrays.inc&amp;diff=6757&amp;oldid=prev</id>
		<title>Jholsenback: link repair</title>
		<link rel="alternate" type="text/html" href="https://wiki.povray.org/content?title=Reference:Arrays.inc&amp;diff=6757&amp;oldid=prev"/>
		<updated>2012-03-15T14:46:21Z</updated>

		<summary type="html">&lt;p&gt;link repair&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[Category:Include Files]]&lt;br /&gt;
{{#indexentry:include files, arrays.inc}}&lt;br /&gt;
&amp;lt;p&amp;gt;This file contains macros for manipulating arrays.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, ARRAYS_WriteDF3}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;ARRAYS_WriteDF3(Array, FileName, BitDepth)&amp;lt;/code&amp;gt;: Write an array to a df3 file.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array that contains the data.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;FileName&amp;lt;/code&amp;gt; = The name of the file to be written.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;BitDepth&amp;lt;/code&amp;gt; = The size of the binary word.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;p class=&amp;quot;Note&amp;quot;&amp;gt;&amp;lt;strong&amp;gt;Note:&amp;lt;/strong&amp;gt; See the [[Reference:File I/O Directives#The write Directive|#write]] directive for more information.&amp;lt;/p&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Rand_Array_Item}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Rand_Array_Item(Array, Stream)&amp;lt;/code&amp;gt;: Randomly Picks an item from a 1D array.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array from which to choose the item.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Stream&amp;lt;/code&amp;gt; = A random number stream.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Resize_Array}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Resize_Array(Array, NewSize)&amp;lt;/code&amp;gt;: Resize a 1D array, retaining its contents.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array to be resized.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;NewSize&amp;lt;/code&amp;gt; = The desired new size of the array.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Reverse_Array}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Reverse_Array(Array)&amp;lt;/code&amp;gt;: Reverses the order of items in a 1D array.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array to be reversed.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Sort_Compare}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Sort_Compare(Array, IdxA, IdxB)&amp;lt;/code&amp;gt;: This macro is used by the &amp;lt;code&amp;gt;Sort_Array()&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;Sort_Partial_Array()&amp;lt;/code&amp;gt; macros. The given macro works for 1D arrays of floats, but&lt;br /&gt;
you can redefine it in your scene file for more complex situations, arrays of vectors or&lt;br /&gt;
multidimensional arrays for example. Just make sure your macro returns true if the item at IdxA &amp;amp;lt;&lt;br /&gt;
the item at IdxB, and otherwise returns false.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array containing the data being sorted.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;IdxA, IdxB&amp;lt;/code&amp;gt; = The array offsets of the data elements being compared.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Sort_Swap_Data}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Sort_Swap_Data(Array, IdxA, IdxB)&amp;lt;/code&amp;gt;: This macro is used by the &amp;lt;code&amp;gt;Sort_Array()&amp;lt;/code&amp;gt;&lt;br /&gt;
and &amp;lt;code&amp;gt;Sort_Partial_Array()&amp;lt;/code&amp;gt; macros. The given macro works for 1D arrays only,&lt;br /&gt;
but you can redefine it in your scene file to handle multidimensional arrays if needed.&lt;br /&gt;
The only requirement is that your macro swaps the data at IdxA with that at IdxB.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array containing the data being sorted.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;IdxA, IdxB&amp;lt;/code&amp;gt; = The array offsets of the data elements being swapped.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Sort_Array}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Sort_Array(Array)&amp;lt;/code&amp;gt;: This macro sorts a 1D array of floats, though you can&lt;br /&gt;
redefine the &amp;lt;code&amp;gt;Sort_Compare()&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;Sort_Swap_Data()&amp;lt;/code&amp;gt; macros to &lt;br /&gt;
handle multidimensional arrays and other data types.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array to be sorted.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{{#indexentry:include files, Sort_Partial_Array}}&lt;br /&gt;
&amp;lt;p&amp;gt;&amp;lt;code&amp;gt;Sort_Partial_Array(Array, FirstInd, LastInd)&amp;lt;/code&amp;gt;: This macro is like&lt;br /&gt;
&amp;lt;code&amp;gt;Sort_Array()&amp;lt;/code&amp;gt;, but sorts a specific range of an array instead of the whole array.&amp;lt;/p&amp;gt;&lt;br /&gt;
&amp;lt;p&amp;gt;Parameters:&amp;lt;/p&amp;gt;&lt;br /&gt;
	&amp;lt;ul&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;Array&amp;lt;/code&amp;gt; = The array to be sorted.&amp;lt;/li&amp;gt;&lt;br /&gt;
		&amp;lt;li&amp;gt;&amp;lt;code&amp;gt;FirstInd, LastInd&amp;lt;/code&amp;gt; = The start and end indices of the range being sorted.&amp;lt;/li&amp;gt;&lt;br /&gt;
	&amp;lt;/ul&amp;gt;&lt;/div&gt;</summary>
		<author><name>Jholsenback</name></author>
	</entry>
</feed>