bot18
Version:
A high-frequency cryptocurrency trading bot by Zenbot creator @carlos8f
4,499 lines (1,236 loc) • 110 kB
HTML
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: mat4</title>
<script src="scripts/prettify/prettify.js"> </script>
<script src="scripts/prettify/lang-css.js"> </script>
<!--[if lt IE 9]>
<script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
<link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>
<body>
<div id="main">
<h1 class="page-title">Module: mat4</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description">4x4 Matrix<br>Format: column-major, when typed out it looks like row-major<br>The matrices are being post multiplied.</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line3">line 3</a>
</li></ul></dd>
</dl>
</div>
<h3 class="subsection-title">Methods</h3>
<h4 class="name" id=".add"><span class="type-signature">(static) </span>add<span class="signature">(out, a, b)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Adds two mat4's
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the first operand</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the second operand</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1542">line 1542</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".adjoint"><span class="type-signature">(static) </span>adjoint<span class="signature">(out, a)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Calculates the adjugate of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line308">line 308</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".clone"><span class="type-signature">(static) </span>clone<span class="signature">(a)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a new mat4 initialized with values from an existing matrix
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">matrix to clone</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line40">line 40</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 4x4 matrix
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".copy"><span class="type-signature">(static) </span>copy<span class="signature">(out, a)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Copy the values from one mat4 to another
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the receiving matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line68">line 68</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">()</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a new identity mat4
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 4x4 matrix
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".determinant"><span class="type-signature">(static) </span>determinant<span class="signature">(a)</span><span class="type-signature"> → {Number}</span></h4>
<div class="description">
Calculates the determinant of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the source matrix</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line339">line 339</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
determinant of a
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".equals"><span class="type-signature">(static) </span>equals<span class="signature">(a, b)</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Returns whether or not the matrices have approximately the same elements in the same position.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">The first matrix.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">The second matrix.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1668">line 1668</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the matrices are equal, false otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".exactEquals"><span class="type-signature">(static) </span>exactEquals<span class="signature">(a, b)</span><span class="type-signature"> → {Boolean}</span></h4>
<div class="description">
Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">The first matrix.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">The second matrix.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1654">line 1654</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the matrices are equal, false otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".frob"><span class="type-signature">(static) </span>frob<span class="signature">(a)</span><span class="type-signature"> → {Number}</span></h4>
<div class="description">
Returns Frobenius norm of a mat4
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">the matrix to calculate Frobenius norm of</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1530">line 1530</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
Frobenius norm
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".fromQuat"><span class="type-signature">(static) </span>fromQuat<span class="signature">(out, q)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Calculates a 4x4 matrix from the given quaternion
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat</span>
</td>
<td class="description last">Quaternion to create matrix from</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1184">line 1184</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromQuat2"><span class="type-signature">(static) </span>fromQuat2<span class="signature">(out, a)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a new mat4 from a dual quat.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">Matrix</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">quat2</span>
</td>
<td class="description last">Dual Quaternion</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line936">line 936</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
mat4 receiving operation result
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromRotation"><span class="type-signature">(static) </span>fromRotation<span class="signature">(out, rad, axis)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a given angle around a given axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotate(dest, dest, rad, axis);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
<tr>
<td class="name"><code>axis</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">the axis to rotate around</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line736">line 736</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromRotationTranslation"><span class="type-signature">(static) </span>fromRotationTranslation<span class="signature">(out, q, v)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation and vector translation
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line892">line 892</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromRotationTranslationScale"><span class="type-signature">(static) </span>fromRotationTranslationScale<span class="signature">(out, q, v, s)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation, vector translation and vector scale
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1061">line 1061</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromRotationTranslationScaleOrigin"><span class="type-signature">(static) </span>fromRotationTranslationScaleOrigin<span class="signature">(out, q, v, s, o)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, vec);
mat4.translate(dest, origin);
let quatMat = mat4.create();
quat4.toMat4(quat, quatMat);
mat4.multiply(dest, quatMat);
mat4.scale(dest, scale)
mat4.translate(dest, negativeOrigin);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">quat4</span>
</td>
<td class="description last">Rotation quaternion</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
<tr>
<td class="name"><code>s</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
<tr>
<td class="name"><code>o</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">The origin vector around which to scale and rotate</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line1121">line 1121</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromScaling"><span class="type-signature">(static) </span>fromScaling<span class="signature">(out, v)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a vector scaling
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.scale(dest, dest, vec);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Scaling vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line704">line 704</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromTranslation"><span class="type-signature">(static) </span>fromTranslation<span class="signature">(out, v)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from a vector translation
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.translate(dest, dest, vec);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>v</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">Translation vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line673">line 673</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromValues"><span class="type-signature">(static) </span>fromValues<span class="signature">(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Create a new mat4 with the given values
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>m00</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 0 position (index 0)</td>
</tr>
<tr>
<td class="name"><code>m01</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 1 position (index 1)</td>
</tr>
<tr>
<td class="name"><code>m02</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 2 position (index 2)</td>
</tr>
<tr>
<td class="name"><code>m03</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 0, row 3 position (index 3)</td>
</tr>
<tr>
<td class="name"><code>m10</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 0 position (index 4)</td>
</tr>
<tr>
<td class="name"><code>m11</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 1 position (index 5)</td>
</tr>
<tr>
<td class="name"><code>m12</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 2 position (index 6)</td>
</tr>
<tr>
<td class="name"><code>m13</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 1, row 3 position (index 7)</td>
</tr>
<tr>
<td class="name"><code>m20</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 0 position (index 8)</td>
</tr>
<tr>
<td class="name"><code>m21</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 1 position (index 9)</td>
</tr>
<tr>
<td class="name"><code>m22</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 2 position (index 10)</td>
</tr>
<tr>
<td class="name"><code>m23</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 2, row 3 position (index 11)</td>
</tr>
<tr>
<td class="name"><code>m30</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 0 position (index 12)</td>
</tr>
<tr>
<td class="name"><code>m31</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 1 position (index 13)</td>
</tr>
<tr>
<td class="name"><code>m32</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 2 position (index 14)</td>
</tr>
<tr>
<td class="name"><code>m33</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Component in column 3, row 3 position (index 15)</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line109">line 109</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
A new mat4
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromXRotation"><span class="type-signature">(static) </span>fromXRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from the given angle around the X axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateX(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line783">line 783</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromYRotation"><span class="type-signature">(static) </span>fromYRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from the given angle around the Y axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateY(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line818">line 818</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".fromZRotation"><span class="type-signature">(static) </span>fromZRotation<span class="signature">(out, rad)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Creates a matrix from the given angle around the Z axis
This is equivalent to (but much faster than):
mat4.identity(dest);
mat4.rotateZ(dest, dest, rad);
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 receiving operation result</td>
</tr>
<tr>
<td class="name"><code>rad</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the angle to rotate the matrix by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="mat4.js.html">mat4.js</a>, <a href="mat4.js.html#line853">line 853</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">mat4</span>
</dd>
</dl>
<h4 class="name" id=".frustum"><span class="type-signature">(static) </span>frustum<span class="signature">(out, left, right, bottom, top, near, far)</span><span class="type-signature"> → {mat4}</span></h4>
<div class="description">
Generates a frustum matrix with the given bounds
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">mat4</span>
</td>
<td class="description last">mat4 frustum matrix will be written into</td>
</tr>
<tr>
<td class="name"><code>left</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Left bound of the frustum</td>
</tr>
<tr>
<td class="name"><code>right</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Right bound of the frustum</td>
</tr>
<tr>
<td class="name"><code>bottom</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Bottom bound of the frustum</td>
</tr>
<tr>
<td class="name"><code>top</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Top bound of the frustum</td>
</tr>
<tr>
<td class="name"><code>near</code></td>