summaryrefslogtreecommitdiff
path: root/manuals/chickadee/Matrices.html
diff options
context:
space:
mode:
authorDavid Thompson <dthompson2@worcester.edu>2021-04-13 11:30:50 -0400
committerDavid Thompson <dthompson2@worcester.edu>2021-04-13 11:30:50 -0400
commitce9d6e8ad28b2d84d1a292a871c23b66a4654b54 (patch)
treeade44e7bb7b891c9ae0ceba18633ef4b2a911a7c /manuals/chickadee/Matrices.html
parent2a30eb2a2d5472be3df1254d5d4d04310314e628 (diff)
Add new guile-sdl2 and chickadee releases.
Diffstat (limited to 'manuals/chickadee/Matrices.html')
-rw-r--r--manuals/chickadee/Matrices.html118
1 files changed, 110 insertions, 8 deletions
diff --git a/manuals/chickadee/Matrices.html b/manuals/chickadee/Matrices.html
index 367c3b6..d616fa8 100644
--- a/manuals/chickadee/Matrices.html
+++ b/manuals/chickadee/Matrices.html
@@ -33,7 +33,7 @@ http://www.texinfo.org/ (GNU Texinfo).
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Math.html" rel="up" title="Math">
<link href="Quaternions.html" rel="next" title="Quaternions">
-<link href="Grid.html" rel="prev" title="Grid">
+<link href="Rectangles.html" rel="prev" title="Rectangles">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
@@ -82,24 +82,126 @@ ul.no-bullet {list-style: none}
<body lang="en">
<span id="Matrices"></span><div class="header">
<p>
-Next: <a href="Quaternions.html" accesskey="n" rel="next">Quaternions</a>, Previous: <a href="Grid.html" accesskey="p" rel="prev">Grid</a>, Up: <a href="Math.html" accesskey="u" rel="up">Math</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
+Next: <a href="Quaternions.html" accesskey="n" rel="next">Quaternions</a>, Previous: <a href="Rectangles.html" accesskey="p" rel="prev">Rectangles</a>, Up: <a href="Math.html" accesskey="u" rel="up">Math</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
-<span id="Matrices-1"></span><h4 class="subsection">2.2.5 Matrices</h4>
+<span id="Matrices-1"></span><h4 class="subsection">2.2.4 Matrices</h4>
<p>The <code>(chickadee math matrix)</code> module provides an interface for
working with the most common type of matrices in game development: 4x4
transformation matrices.
</p>
-<span id="Another-Note-About-Performance"></span><h4 class="subsubsection">2.2.5.1 Another Note About Performance</h4>
-
+<p><em>Another Note About Performance</em>
+</p>
<p>Much like the vector API, the matrix API is commonly used in
performance critical code paths. In order to reduce the amount of
garbage generated and improve matrix multiplication performance, there
are many procedures that perform in-place modifications of matrix
objects.
</p>
-<span id="Matrix-Operations"></span><h4 class="subsubsection">2.2.5.2 Matrix Operations</h4>
+<span id="g_t3x3-Matrices"></span><h4 class="subsubsection">2.2.4.1 3x3 Matrices</h4>
+
+<dl>
+<dt id="index-make_002dmatrix3">Procedure: <strong>make-matrix3</strong> <em>aa ab ac ba bb bc ca cb cc</em></dt>
+<dd><p>Return a new 3x3 initialized with the given 9 values in column-major
+format.
+</p></dd></dl>
+
+<dl>
+<dt id="index-make_002dnull_002dmatrix3">Procedure: <strong>make-null-matrix3</strong></dt>
+<dd><p>Return a new 3x3 matrix with all values initialized to 0.
+</p></dd></dl>
+
+<dl>
+<dt id="index-make_002didentity_002dmatrix3">Procedure: <strong>make-identity-matrix3</strong></dt>
+<dd><p>Return a new 3x3 identity matrix. Any matrix multiplied by the
+identity matrix yields the original matrix. This procedure is
+equivalent to the following code:
+</p>
+<div class="example">
+<pre class="example">(make-matrix3 1 0 0
+ 0 1 0
+ 0 0 1)
+</pre></div>
+
+</dd></dl>
+
+<dl>
+<dt id="index-matrix3_003f">Procedure: <strong>matrix3?</strong> <em>obj</em></dt>
+<dd><p>Return <code>#t</code> if <var>obj</var> is a 3x3 matrix.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002a">Procedure: <strong>matrix3*</strong> <em>. matrices</em></dt>
+<dd><p>Return a new 3x3 matrix containing the product of multiplying all of
+the given <var>matrices</var>.
+</p>
+<p>Note: Remember that matrix multiplication is <strong>not</strong> commutative!
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dtranslate">Procedure: <strong>matrix3-translate</strong> <em>v</em></dt>
+<dd><p>Return a new 3x3 matrix that represents a translation by <var>v</var>, a 2D
+vector.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dscale">Procedure: <strong>matrix3-scale</strong> <em>s</em></dt>
+<dd><p>Return a new 3x3 matrix that represents a scaling along the x and y
+axes by the scaling factor <var>s</var>, a number or 2D vector.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002drotate">Procedure: <strong>matrix3-rotate</strong> <em>angle</em></dt>
+<dd><p>Return a new 3x3 matrix that represents a rotation by <var>angle</var>
+radians.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dtransform">Procedure: <strong>matrix3-transform</strong> <em>matrix v</em></dt>
+<dd><p>Return a new 2D vector that is <var>v</var> as transformed by the 3x3
+matrix <var>matrix</var>.
+</p></dd></dl>
+
+<p>The following procedures perform in-place, destructive updates to 3x3
+matrix objects:
+</p>
+<dl>
+<dt id="index-matrix3_002didentity_0021">Procedure: <strong>matrix3-identity!</strong> <em>matrix</em></dt>
+<dd><p>Modify <var>matrix</var> in-place to contain the identity matrix.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dmult_0021">Procedure: <strong>matrix3-mult!</strong> <em>dest a b</em></dt>
+<dd><p>Multiply the 3x3 matrix <var>a</var> by the 3x3 matrix <var>b</var> and store
+the result in the 3x3 matrix <var>dest</var>.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dtranslate_0021">Procedure: <strong>matrix3-translate!</strong> <em>matrix v</em></dt>
+<dd><p>Modify <var>matrix</var> in-place to contain a translation by <var>v</var>, a 2D
+vector.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dscale_0021">Procedure: <strong>matrix3-scale!</strong> <em>matrix s</em></dt>
+<dd><p>Modify <var>matrix</var> in-place to contain a scaling along the x and y
+axes by the scaling factor <var>s</var>, a number or 2D vector.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002drotate_0021">Procedure: <strong>matrix3-rotate!</strong> <em>matrix angle</em></dt>
+<dd><p>Modify <var>matrix</var> in-place to contain a rotation by <var>angle</var>
+radians.
+</p></dd></dl>
+
+<dl>
+<dt id="index-matrix3_002dtransform_0021">Procedure: <strong>matrix3-transform!</strong> <em>matrix v</em></dt>
+<dd><p>Modify the 2D vector <var>v</var> in-place to contain <var>v</var> as
+transformed by the 3x3 matrix <var>matrix</var>.
+</p></dd></dl>
+
+<span id="g_t4x4-Matrices"></span><h4 class="subsubsection">2.2.4.2 4x4 Matrices</h4>
<dl>
<dt id="index-make_002dmatrix4">Procedure: <strong>make-matrix4</strong> <em>aa ab ac ad ba bb bc bd ca cb cc cd da db dc dd</em></dt>
@@ -232,7 +334,7 @@ particular transformation will not be included in the result.
</p></dd></dl>
<dl>
-<dt id="index-transform_0021">Procedure: <strong>transform!</strong> <em>matrix v</em></dt>
+<dt id="index-matrix4_002dtransform_0021">Procedure: <strong>matrix4-transform!</strong> <em>matrix v</em></dt>
<dd><p>Modify the 2D vector <var>v</var> in-place by multiplying it by the 4x4
matrix <var>matrix</var>.
</p></dd></dl>
@@ -240,7 +342,7 @@ matrix <var>matrix</var>.
<hr>
<div class="header">
<p>
-Next: <a href="Quaternions.html" accesskey="n" rel="next">Quaternions</a>, Previous: <a href="Grid.html" accesskey="p" rel="prev">Grid</a>, Up: <a href="Math.html" accesskey="u" rel="up">Math</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
+Next: <a href="Quaternions.html" accesskey="n" rel="next">Quaternions</a>, Previous: <a href="Rectangles.html" accesskey="p" rel="prev">Rectangles</a>, Up: <a href="Math.html" accesskey="u" rel="up">Math</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Index.html" title="Index" rel="index">Index</a>]</p>
</div>