<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="/templates/xsl/lab.xsl"?>
<entry>
	<title>Sin, Cos, Tan - Random 3D Particles - haXe &amp; flash 10</title>
	<swf>
		<url>Random.swf</url>
		<width>800</width>
		<height>450</height>
	</swf>
	<info>
    <p>
    	This example is quite simply a visual representation of 1,536,000 calls to Math.random(), each set of 3 values is taken as x,y,z co-ordinates of a particle, scaled up to fit on screen then rendered. Thus creating 512,000 particles.
    </p>
    <p>
    	The exact formula / method used is under Simplified &amp; Snipped Code below.
    </p>
    <h3>Variations</h3>
    <p>
    	This simple formula can produce rather interesting &amp; different results by simply modifying scale values for each axis independently, more examples of this can be found here:
    </p>
    <ul>
    	<li><a href="/experiments/basic-3d-particles/particle-cube-sin-cos-tan/">Original</a> (this one)</li>
        <li><a href="/experiments/basic-3d-particles/particle-cube-sin-cos-tan-v1/">Variation 1</a></li>
    </ul>
    <p>
    	Full details and more examples can be found at <a href="http://webr3.org/blog/">webr3.org/blog</a>.
    </p>
	</info>
	<sources>
		<snip>
<pre>for( i in 0...PARTICLES ) {
	x = ( ( Math.random() + Math.tan(i/PARTICLES) ) / 2 ) * SCALE;
	y = ( ( Math.random() + Math.cos(i/PARTICLES) ) / 2 ) * SCALE;
	z = ( ( Math.random() + Math.sin(i/PARTICLES) ) / 2 ) * SCALE;
}</pre>
		</snip>
	</sources>
</entry>
