gl-matrix/docs/module-vec3.html
Brandon Jones accefb6ddf Update version to 3.4.4
Also updated multiple NPM dependencies (most notably Typescript to v5)
and rebased on main branch.
2025-08-08 11:08:24 -07:00

9190 lines
93 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>JSDoc: Module: vec3</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: vec3</h1>
<section>
<header>
</header>
<article>
<div class="container-overview">
<div class="description">3 Dimensional Vector</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.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"> &rarr; {vec3}</span></h4>
<div class="description">
Adds two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line104">line 104</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".angle"><span class="type-signature">(static) </span>angle<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Get the angle between two 3D vectors
</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">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line669">line 669</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
The angle in radians
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".bezier"><span class="type-signature">(static) </span>bezier<span class="signature">(out, a, b, c, d, t)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Performs a bezier interpolation with two control points
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</span>
</td>
<td class="description last">the second operand</td>
</tr>
<tr>
<td class="name"><code>c</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the third operand</td>
</tr>
<tr>
<td class="name"><code>d</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the fourth operand</td>
</tr>
<tr>
<td class="name"><code>t</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">interpolation amount, in the range [0-1], between the two inputs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line460">line 460</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".ceil"><span class="type-signature">(static) </span>ceil<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Math.ceil the components of a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to ceil</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line163">line 163</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".clone"><span class="type-signature">(static) </span>clone<span class="signature">(a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Creates a new vec3 initialized with values from an existing vector
</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">ReadonlyVec3</span>
</td>
<td class="description last">vector 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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line29">line 29</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 3D vector
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</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"> &rarr; {vec3}</span></h4>
<div class="description">
Copy the values from one vec3 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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the source vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line73">line 73</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".create"><span class="type-signature">(static) </span>create<span class="signature">()</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Creates a new, empty vec3
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line13">line 13</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 3D vector
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".cross"><span class="type-signature">(static) </span>cross<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Computes the cross product of two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line369">line 369</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".dist"><span class="type-signature">(static) </span>dist<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.distance
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line761">line 761</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".distance"><span class="type-signature">(static) </span>distance<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Calculates the euclidian distance between two vec3'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>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line266">line 266</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
distance between a and b
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".div"><span class="type-signature">(static) </span>div<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.divide
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line755">line 755</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".divide"><span class="type-signature">(static) </span>divide<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Divides two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line149">line 149</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".dot"><span class="type-signature">(static) </span>dot<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Calculates the dot product of two vec3'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>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line357">line 357</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
dot product of a and b
</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"> &rarr; {Boolean}</span></h4>
<div class="description">
Returns whether or not the vectors 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">ReadonlyVec3</span>
</td>
<td class="description last">The first vector.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The second vector.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line722">line 722</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the vectors 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"> &rarr; {Boolean}</span></h4>
<div class="description">
Returns whether or not the vectors 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">ReadonlyVec3</span>
</td>
<td class="description last">The first vector.</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The second vector.</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line711">line 711</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
True if the vectors are equal, false otherwise.
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Boolean</span>
</dd>
</dl>
<h4 class="name" id=".floor"><span class="type-signature">(static) </span>floor<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Math.floor the components of a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to floor</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line177">line 177</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".forEach"><span class="type-signature">(static) </span>forEach<span class="signature">(a, stride, offset, count, fn, arg<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {Array}</span></h4>
<div class="description">
Perform some operation over an array of vec3s.
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">Array</span>
</td>
<td class="attributes">
</td>
<td class="description last">the array of vectors to iterate over</td>
</tr>
<tr>
<td class="name"><code>stride</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last">Number of elements between the start of each vec3. If 0 assumes tightly packed</td>
</tr>
<tr>
<td class="name"><code>offset</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last">Number of elements to skip at the beginning of the array</td>
</tr>
<tr>
<td class="name"><code>count</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
</td>
<td class="description last">Number of vec3s to iterate over. If 0 iterates over entire array</td>
</tr>
<tr>
<td class="name"><code>fn</code></td>
<td class="type">
<span class="param-type">function</span>
</td>
<td class="attributes">
</td>
<td class="description last">Function to call for each vector in the array</td>
</tr>
<tr>
<td class="name"><code>arg</code></td>
<td class="type">
<span class="param-type">Object</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">additional argument to pass to fn</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line793">line 793</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Array</span>
</dd>
</dl>
<h4 class="name" id=".fromValues"><span class="type-signature">(static) </span>fromValues<span class="signature">(x, y, z)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Creates a new vec3 initialized 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>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">X component</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Y component</td>
</tr>
<tr>
<td class="name"><code>z</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Z component</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line58">line 58</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
a new 3D vector
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".hermite"><span class="type-signature">(static) </span>hermite<span class="signature">(out, a, b, c, d, t)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Performs a hermite interpolation with two control points
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</span>
</td>
<td class="description last">the second operand</td>
</tr>
<tr>
<td class="name"><code>c</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the third operand</td>
</tr>
<tr>
<td class="name"><code>d</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the fourth operand</td>
</tr>
<tr>
<td class="name"><code>t</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">interpolation amount, in the range [0-1], between the two inputs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line435">line 435</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".inverse"><span class="type-signature">(static) </span>inverse<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Returns the inverse of the components of a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to invert</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line321">line 321</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".len"><span class="type-signature">(static) </span>len<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.length
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line773">line 773</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".length"><span class="type-signature">(static) </span>length<span class="signature">(a)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Calculates the length of a vec3
</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">ReadonlyVec3</span>
</td>
<td class="description last">vector to calculate length of</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line43">line 43</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
length of a
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".lerp"><span class="type-signature">(static) </span>lerp<span class="signature">(out, a, b, t)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Performs a linear interpolation between two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</span>
</td>
<td class="description last">the second operand</td>
</tr>
<tr>
<td class="name"><code>t</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">interpolation amount, in the range [0-1], between the two inputs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line392">line 392</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".max"><span class="type-signature">(static) </span>max<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Returns the maximum of two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line207">line 207</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".min"><span class="type-signature">(static) </span>min<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Returns the minimum of two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line192">line 192</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".mul"><span class="type-signature">(static) </span>mul<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.multiply
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line749">line 749</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".multiply"><span class="type-signature">(static) </span>multiply<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Multiplies two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line134">line 134</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".negate"><span class="type-signature">(static) </span>negate<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Negates the components of a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to negate</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line307">line 307</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".normalize"><span class="type-signature">(static) </span>normalize<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Normalize a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to normalize</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line335">line 335</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".random"><span class="type-signature">(static) </span>random<span class="signature">(out, scale<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Generates a random vector with the given scale
</div>
<h5>Parameters:</h5>
<table class="params">
<thead>
<tr>
<th>Name</th>
<th>Type</th>
<th>Attributes</th>
<th class="last">Description</th>
</tr>
</thead>
<tbody>
<tr>
<td class="name"><code>out</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="attributes">
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>scale</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="attributes">
&lt;optional><br>
</td>
<td class="description last">Length of the resulting vector. If omitted, a unit vector will be returned</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line483">line 483</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".rotateX"><span class="type-signature">(static) </span>rotateX<span class="signature">(out, a, b, rad)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Rotate a 3D vector around the x-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">vec3</span>
</td>
<td class="description last">The receiving vec3</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The vec3 point to rotate</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The origin of the rotation</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 of rotation in radians</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line584">line 584</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".rotateY"><span class="type-signature">(static) </span>rotateY<span class="signature">(out, a, b, rad)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Rotate a 3D vector around the y-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">vec3</span>
</td>
<td class="description last">The receiving vec3</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The vec3 point to rotate</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The origin of the rotation</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 of rotation in radians</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line613">line 613</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".rotateZ"><span class="type-signature">(static) </span>rotateZ<span class="signature">(out, a, b, rad)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Rotate a 3D vector around the z-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">vec3</span>
</td>
<td class="description last">The receiving vec3</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The vec3 point to rotate</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">The origin of the rotation</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 of rotation in radians</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line642">line 642</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".round"><span class="type-signature">(static) </span>round<span class="signature">(out, a)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
symmetric round the components of a vec3
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">vector to round</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line221">line 221</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".scale"><span class="type-signature">(static) </span>scale<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Scales a vec3 by a scalar number
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the vector to scale</td>
</tr>
<tr>
<td class="name"><code>b</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">amount to scale the vector by</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line236">line 236</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".scaleAndAdd"><span class="type-signature">(static) </span>scaleAndAdd<span class="signature">(out, a, b, scale)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Adds two vec3's after scaling the second operand by a scalar value
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</span>
</td>
<td class="description last">the second operand</td>
</tr>
<tr>
<td class="name"><code>scale</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">the amount to scale b by before adding</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line252">line 252</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".set"><span class="type-signature">(static) </span>set<span class="signature">(out, x, y, z)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Set the components of a vec3 to 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>out</code></td>
<td class="type">
<span class="param-type">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>x</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">X component</td>
</tr>
<tr>
<td class="name"><code>y</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Y component</td>
</tr>
<tr>
<td class="name"><code>z</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">Z component</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line89">line 89</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".slerp"><span class="type-signature">(static) </span>slerp<span class="signature">(out, a, b, t)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Performs a spherical linear interpolation between two vec3'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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</span>
</td>
<td class="description last">the second operand</td>
</tr>
<tr>
<td class="name"><code>t</code></td>
<td class="type">
<span class="param-type">Number</span>
</td>
<td class="description last">interpolation amount, in the range [0-1], between the two inputs</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line411">line 411</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".sqrDist"><span class="type-signature">(static) </span>sqrDist<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.squaredDistance
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line767">line 767</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".sqrLen"><span class="type-signature">(static) </span>sqrLen<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.squaredLength
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line779">line 779</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".squaredDistance"><span class="type-signature">(static) </span>squaredDistance<span class="signature">(a, b)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Calculates the squared euclidian distance between two vec3'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>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line280">line 280</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
squared distance between a and b
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".squaredLength"><span class="type-signature">(static) </span>squaredLength<span class="signature">(a)</span><span class="type-signature"> &rarr; {Number}</span></h4>
<div class="description">
Calculates the squared length of a vec3
</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">ReadonlyVec3</span>
</td>
<td class="description last">vector to calculate squared length of</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line293">line 293</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
squared length of a
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">Number</span>
</dd>
</dl>
<h4 class="name" id=".str"><span class="type-signature">(static) </span>str<span class="signature">(a)</span><span class="type-signature"> &rarr; {String}</span></h4>
<div class="description">
Returns a string representation of a vector
</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">ReadonlyVec3</span>
</td>
<td class="description last">vector to represent as a string</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line700">line 700</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
string representation of the vector
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">String</span>
</dd>
</dl>
<h4 class="name" id=".sub"><span class="type-signature">(static) </span>sub<span class="signature">()</span><span class="type-signature"></span></h4>
<div class="description">
Alias for vec3.subtract
</div>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line743">line 743</a>
</li></ul></dd>
</dl>
<h4 class="name" id=".subtract"><span class="type-signature">(static) </span>subtract<span class="signature">(out, a, b)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Subtracts vector b from vector a
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</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">ReadonlyVec3</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="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line119">line 119</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".transformMat3"><span class="type-signature">(static) </span>transformMat3<span class="signature">(out, a, m)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Transforms the vec3 with a mat3.
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the vector to transform</td>
</tr>
<tr>
<td class="name"><code>m</code></td>
<td class="type">
<span class="param-type">ReadonlyMat3</span>
</td>
<td class="description last">the 3x3 matrix to transform with</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line525">line 525</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".transformMat4"><span class="type-signature">(static) </span>transformMat4<span class="signature">(out, a, m)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Transforms the vec3 with a mat4.
4th vector component is implicitly '1'
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the vector to transform</td>
</tr>
<tr>
<td class="name"><code>m</code></td>
<td class="type">
<span class="param-type">ReadonlyMat4</span>
</td>
<td class="description last">matrix to transform with</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line505">line 505</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".transformQuat"><span class="type-signature">(static) </span>transformQuat<span class="signature">(out, a, q)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Transforms the vec3 with a quat
Can also be used for dual quaternions. (Multiply it with the real part)
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
<tr>
<td class="name"><code>a</code></td>
<td class="type">
<span class="param-type">ReadonlyVec3</span>
</td>
<td class="description last">the vector to transform</td>
</tr>
<tr>
<td class="name"><code>q</code></td>
<td class="type">
<span class="param-type">ReadonlyQuat</span>
</td>
<td class="description last">normalized quaternion to transform with</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line544">line 544</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
<h4 class="name" id=".zero"><span class="type-signature">(static) </span>zero<span class="signature">(out)</span><span class="type-signature"> &rarr; {vec3}</span></h4>
<div class="description">
Set the components of a vec3 to zero
</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">vec3</span>
</td>
<td class="description last">the receiving vector</td>
</tr>
</tbody>
</table>
<dl class="details">
<dt class="tag-source">Source:</dt>
<dd class="tag-source"><ul class="dummy"><li>
<a href="vec3.js.html">vec3.js</a>, <a href="vec3.js.html#line687">line 687</a>
</li></ul></dd>
</dl>
<h5>Returns:</h5>
<div class="param-desc">
out
</div>
<dl>
<dt>
Type
</dt>
<dd>
<span class="param-type">vec3</span>
</dd>
</dl>
</article>
</section>
</div>
<nav>
<h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-glMatrix.html">glMatrix</a></li><li><a href="module-mat2.html">mat2</a></li><li><a href="module-mat2d.html">mat2d</a></li><li><a href="module-mat3.html">mat3</a></li><li><a href="module-mat4.html">mat4</a></li><li><a href="module-quat.html">quat</a></li><li><a href="module-quat2.html">quat2</a></li><li><a href="module-vec2.html">vec2</a></li><li><a href="module-vec3.html">vec3</a></li><li><a href="module-vec4.html">vec4</a></li></ul>
</nav>
<br class="clear">
<footer>
Documentation generated by <a href="https://github.com/jsdoc/jsdoc">JSDoc 3.6.7</a> on Fri Aug 08 2025 11:06:23 GMT-0700 (Pacific Daylight Time)
</footer>
<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>