vex/reference/index.html @ 0f6bab39c0f4 default tip

adopt: Update site.
author Steve Losh <steve@stevelosh.com>
date Thu, 13 Jun 2024 13:05:28 -0400
parents 6f15e325545d
children (none)
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <title> API Reference / vex</title>
        <link rel="stylesheet" href="../_dmedia/tango.css"/>
        <link rel="stylesheet/less" type="text/css" href="../_dmedia/style.less"/>
        <script src="../_dmedia/less.js" type="text/javascript">
        </script>
    </head>
    <body class="content">
        <div class="wrap">
            <header><h1><a href="..">vex</a></h1></header>
                <div class="markdown">
<h1 id="api-reference"><a href="">API Reference</a></h1><p>The following is a list of all user-facing parts of Vex.</p>
<p>If there are backwards-incompatible changes to anything listed here, they will
be noted in the changelog and the author will feel bad.</p>
<p>Anything not listed here is subject to change at any time with no warning, so
don't touch it.</p>
<div class="toc">
<ul>
<li><a href="#package-vex">Package VEX</a><ul>
<li><a href="#vec2-struct">VEC2 (struct)</a></li>
<li><a href="#vec2-add-function">VEC2-ADD (function)</a></li>
<li><a href="#vec2-add-function_1">VEC2-ADD! (function)</a></li>
<li><a href="#vec2-add-function_2">VEC2-ADD* (function)</a></li>
<li><a href="#vec2-add-function_3">VEC2-ADD*! (function)</a></li>
<li><a href="#vec2-angle-function">VEC2-ANGLE (function)</a></li>
<li><a href="#vec2-direction-function">VEC2-DIRECTION (function)</a></li>
<li><a href="#vec2-div-function">VEC2-DIV (function)</a></li>
<li><a href="#vec2-div-function_1">VEC2-DIV! (function)</a></li>
<li><a href="#vec2-eql-function">VEC2-EQL (function)</a></li>
<li><a href="#vec2-length-function">VEC2-LENGTH (function)</a></li>
<li><a href="#vec2-magdir-function">VEC2-MAGDIR (function)</a></li>
<li><a href="#vec2-magnitude-function">VEC2-MAGNITUDE (function)</a></li>
<li><a href="#vec2-mul-function">VEC2-MUL (function)</a></li>
<li><a href="#vec2-mul-function_1">VEC2-MUL! (function)</a></li>
<li><a href="#vec2-sub-function">VEC2-SUB (function)</a></li>
<li><a href="#vec2-sub-function_1">VEC2-SUB! (function)</a></li>
<li><a href="#vec2-sub-function_2">VEC2-SUB* (function)</a></li>
<li><a href="#vec2-sub-function_3">VEC2-SUB*! (function)</a></li>
<li><a href="#vec2-unit-x-function">VEC2-UNIT-X (function)</a></li>
<li><a href="#vec2-unit-y-function">VEC2-UNIT-Y (function)</a></li>
<li><a href="#vec2-x-function">VEC2-X (function)</a></li>
<li><a href="#vec2-xy-function">VEC2-XY (function)</a></li>
<li><a href="#vec2-xy-function_1">VEC2-XY! (function)</a></li>
<li><a href="#vec2-y-function">VEC2-Y (function)</a></li>
<li><a href="#vec2-yx-function">VEC2-YX (function)</a></li>
<li><a href="#vec2-yx-function_1">VEC2-YX! (function)</a></li>
<li><a href="#vec2-zero-function">VEC2-ZERO (function)</a></li>
<li><a href="#vec2d-struct">VEC2D (struct)</a></li>
<li><a href="#vec2d-add-function">VEC2D-ADD (function)</a></li>
<li><a href="#vec2d-add-function_1">VEC2D-ADD! (function)</a></li>
<li><a href="#vec2d-add-function_2">VEC2D-ADD* (function)</a></li>
<li><a href="#vec2d-add-function_3">VEC2D-ADD*! (function)</a></li>
<li><a href="#vec2d-angle-function">VEC2D-ANGLE (function)</a></li>
<li><a href="#vec2d-direction-function">VEC2D-DIRECTION (function)</a></li>
<li><a href="#vec2d-div-function">VEC2D-DIV (function)</a></li>
<li><a href="#vec2d-div-function_1">VEC2D-DIV! (function)</a></li>
<li><a href="#vec2d-eql-function">VEC2D-EQL (function)</a></li>
<li><a href="#vec2d-length-function">VEC2D-LENGTH (function)</a></li>
<li><a href="#vec2d-magdir-function">VEC2D-MAGDIR (function)</a></li>
<li><a href="#vec2d-magnitude-function">VEC2D-MAGNITUDE (function)</a></li>
<li><a href="#vec2d-mul-function">VEC2D-MUL (function)</a></li>
<li><a href="#vec2d-mul-function_1">VEC2D-MUL! (function)</a></li>
<li><a href="#vec2d-sub-function">VEC2D-SUB (function)</a></li>
<li><a href="#vec2d-sub-function_1">VEC2D-SUB! (function)</a></li>
<li><a href="#vec2d-sub-function_2">VEC2D-SUB* (function)</a></li>
<li><a href="#vec2d-sub-function_3">VEC2D-SUB*! (function)</a></li>
<li><a href="#vec2d-unit-x-function">VEC2D-UNIT-X (function)</a></li>
<li><a href="#vec2d-unit-y-function">VEC2D-UNIT-Y (function)</a></li>
<li><a href="#vec2d-x-function">VEC2D-X (function)</a></li>
<li><a href="#vec2d-xy-function">VEC2D-XY (function)</a></li>
<li><a href="#vec2d-xy-function_1">VEC2D-XY! (function)</a></li>
<li><a href="#vec2d-y-function">VEC2D-Y (function)</a></li>
<li><a href="#vec2d-yx-function">VEC2D-YX (function)</a></li>
<li><a href="#vec2d-yx-function_1">VEC2D-YX! (function)</a></li>
<li><a href="#vec2d-zero-function">VEC2D-ZERO (function)</a></li>
<li><a href="#vec2f-struct">VEC2F (struct)</a></li>
<li><a href="#vec2f-add-function">VEC2F-ADD (function)</a></li>
<li><a href="#vec2f-add-function_1">VEC2F-ADD! (function)</a></li>
<li><a href="#vec2f-add-function_2">VEC2F-ADD* (function)</a></li>
<li><a href="#vec2f-add-function_3">VEC2F-ADD*! (function)</a></li>
<li><a href="#vec2f-angle-function">VEC2F-ANGLE (function)</a></li>
<li><a href="#vec2f-direction-function">VEC2F-DIRECTION (function)</a></li>
<li><a href="#vec2f-div-function">VEC2F-DIV (function)</a></li>
<li><a href="#vec2f-div-function_1">VEC2F-DIV! (function)</a></li>
<li><a href="#vec2f-eql-function">VEC2F-EQL (function)</a></li>
<li><a href="#vec2f-length-function">VEC2F-LENGTH (function)</a></li>
<li><a href="#vec2f-magdir-function">VEC2F-MAGDIR (function)</a></li>
<li><a href="#vec2f-magnitude-function">VEC2F-MAGNITUDE (function)</a></li>
<li><a href="#vec2f-mul-function">VEC2F-MUL (function)</a></li>
<li><a href="#vec2f-mul-function_1">VEC2F-MUL! (function)</a></li>
<li><a href="#vec2f-sub-function">VEC2F-SUB (function)</a></li>
<li><a href="#vec2f-sub-function_1">VEC2F-SUB! (function)</a></li>
<li><a href="#vec2f-sub-function_2">VEC2F-SUB* (function)</a></li>
<li><a href="#vec2f-sub-function_3">VEC2F-SUB*! (function)</a></li>
<li><a href="#vec2f-unit-x-function">VEC2F-UNIT-X (function)</a></li>
<li><a href="#vec2f-unit-y-function">VEC2F-UNIT-Y (function)</a></li>
<li><a href="#vec2f-x-function">VEC2F-X (function)</a></li>
<li><a href="#vec2f-xy-function">VEC2F-XY (function)</a></li>
<li><a href="#vec2f-xy-function_1">VEC2F-XY! (function)</a></li>
<li><a href="#vec2f-y-function">VEC2F-Y (function)</a></li>
<li><a href="#vec2f-yx-function">VEC2F-YX (function)</a></li>
<li><a href="#vec2f-yx-function_1">VEC2F-YX! (function)</a></li>
<li><a href="#vec2f-zero-function">VEC2F-ZERO (function)</a></li>
<li><a href="#vec2i-struct">VEC2I (struct)</a></li>
<li><a href="#vec2i-add-function">VEC2I-ADD (function)</a></li>
<li><a href="#vec2i-add-function_1">VEC2I-ADD! (function)</a></li>
<li><a href="#vec2i-add-function_2">VEC2I-ADD* (function)</a></li>
<li><a href="#vec2i-add-function_3">VEC2I-ADD*! (function)</a></li>
<li><a href="#vec2i-angle-function">VEC2I-ANGLE (function)</a></li>
<li><a href="#vec2i-direction-function">VEC2I-DIRECTION (function)</a></li>
<li><a href="#vec2i-div-function">VEC2I-DIV (function)</a></li>
<li><a href="#vec2i-div-function_1">VEC2I-DIV! (function)</a></li>
<li><a href="#vec2i-eql-function">VEC2I-EQL (function)</a></li>
<li><a href="#vec2i-length-function">VEC2I-LENGTH (function)</a></li>
<li><a href="#vec2i-magdir-function">VEC2I-MAGDIR (function)</a></li>
<li><a href="#vec2i-magnitude-function">VEC2I-MAGNITUDE (function)</a></li>
<li><a href="#vec2i-mul-function">VEC2I-MUL (function)</a></li>
<li><a href="#vec2i-mul-function_1">VEC2I-MUL! (function)</a></li>
<li><a href="#vec2i-sub-function">VEC2I-SUB (function)</a></li>
<li><a href="#vec2i-sub-function_1">VEC2I-SUB! (function)</a></li>
<li><a href="#vec2i-sub-function_2">VEC2I-SUB* (function)</a></li>
<li><a href="#vec2i-sub-function_3">VEC2I-SUB*! (function)</a></li>
<li><a href="#vec2i-unit-x-function">VEC2I-UNIT-X (function)</a></li>
<li><a href="#vec2i-unit-y-function">VEC2I-UNIT-Y (function)</a></li>
<li><a href="#vec2i-x-function">VEC2I-X (function)</a></li>
<li><a href="#vec2i-xy-function">VEC2I-XY (function)</a></li>
<li><a href="#vec2i-xy-function_1">VEC2I-XY! (function)</a></li>
<li><a href="#vec2i-y-function">VEC2I-Y (function)</a></li>
<li><a href="#vec2i-yx-function">VEC2I-YX (function)</a></li>
<li><a href="#vec2i-yx-function_1">VEC2I-YX! (function)</a></li>
<li><a href="#vec2i-zero-function">VEC2I-ZERO (function)</a></li>
</ul>
</li>
</ul></div>
<h2 id="package-vex">Package <code>VEX</code></h2>
<h3 id="vec2-struct"><code>VEC2</code> (struct)</h3>
<p>A two-dimensional vector of <code>REAL</code>s.</p>
<p>Slots: <code>X</code>, <code>Y</code></p>
<h3 id="vec2-add-function"><code>VEC2-ADD</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ADD V1 V2)
</pre></div>


<p>Add <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2-add-function_1"><code>VEC2-ADD!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ADD! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by adding <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2-add-function_2"><code>VEC2-ADD*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ADD* V X Y)
</pre></div>


<p>Add <code>x</code> and <code>y</code> to the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2-add-function_3"><code>VEC2-ADD*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ADD*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by adding <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2-angle-function"><code>VEC2-ANGLE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ANGLE V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2-direction-function"><code>VEC2-DIRECTION</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-DIRECTION V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2-div-function"><code>VEC2-DIV</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-DIV V SCALAR)
</pre></div>


<p>Divide the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2-div-function_1"><code>VEC2-DIV!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-DIV! V SCALAR)
</pre></div>


<p>Destructively divide the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2-eql-function"><code>VEC2-EQL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-EQL V1 V2 &amp;OPTIONAL EPSILON)
</pre></div>


<p>Return whether <code>v1</code> and <code>v2</code> are componentwise <code>=</code>.</p>
<div class="codehilite"><pre>      If `epsilon` is given, this instead checks that each pair of
      components are within `epsilon` of each other.
</pre></div>


<h3 id="vec2-length-function"><code>VEC2-LENGTH</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-LENGTH V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2-magdir-function"><code>VEC2-MAGDIR</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-MAGDIR MAGNITUDE DIRECTION)
</pre></div>


<p>Create a fresh vector with the given <code>magnitude</code> and <code>direction</code>.</p>
<h3 id="vec2-magnitude-function"><code>VEC2-MAGNITUDE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-MAGNITUDE V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2-mul-function"><code>VEC2-MUL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-MUL V SCALAR)
</pre></div>


<p>Multiply the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2-mul-function_1"><code>VEC2-MUL!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-MUL! V SCALAR)
</pre></div>


<p>Destructively multiply the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2-sub-function"><code>VEC2-SUB</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-SUB V1 V2)
</pre></div>


<p>Subtract <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2-sub-function_1"><code>VEC2-SUB!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-SUB! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by subtracting <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2-sub-function_2"><code>VEC2-SUB*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-SUB* V X Y)
</pre></div>


<p>Subtract <code>x</code> and <code>y</code> from the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2-sub-function_3"><code>VEC2-SUB*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-SUB*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by subtracting <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2-unit-x-function"><code>VEC2-UNIT-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-UNIT-X)
</pre></div>


<p>Return a unit vector in the X direction.</p>
<h3 id="vec2-unit-y-function"><code>VEC2-UNIT-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-UNIT-Y)
</pre></div>


<p>Return a unit vector in the Y direction.</p>
<h3 id="vec2-x-function"><code>VEC2-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-X VALUE INSTANCE)
</pre></div>


<h3 id="vec2-xy-function"><code>VEC2-XY</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-XY V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2</code> of its <code>x</code> and <code>y</code> components.</p>
<h3 id="vec2-xy-function_1"><code>VEC2-XY!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-XY! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>x</code> and <code>y</code>.</p>
<h3 id="vec2-y-function"><code>VEC2-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-Y VALUE INSTANCE)
</pre></div>


<h3 id="vec2-yx-function"><code>VEC2-YX</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-YX V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2</code> of its <code>y</code> and <code>x</code> components.</p>
<h3 id="vec2-yx-function_1"><code>VEC2-YX!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-YX! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>y</code> and <code>x</code>.</p>
<h3 id="vec2-zero-function"><code>VEC2-ZERO</code> (function)</h3>
<div class="codehilite"><pre>(VEC2-ZERO)
</pre></div>


<p>Return a fresh zero vector.</p>
<h3 id="vec2d-struct"><code>VEC2D</code> (struct)</h3>
<p>A two-dimensional vector of <code>DOUBLE-FLOAT</code>s.</p>
<p>Slots: <code>X</code>, <code>Y</code></p>
<h3 id="vec2d-add-function"><code>VEC2D-ADD</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ADD V1 V2)
</pre></div>


<p>Add <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2d-add-function_1"><code>VEC2D-ADD!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ADD! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by adding <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2d-add-function_2"><code>VEC2D-ADD*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ADD* V X Y)
</pre></div>


<p>Add <code>x</code> and <code>y</code> to the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2d-add-function_3"><code>VEC2D-ADD*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ADD*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by adding <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2d-angle-function"><code>VEC2D-ANGLE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ANGLE V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2d-direction-function"><code>VEC2D-DIRECTION</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-DIRECTION V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2d-div-function"><code>VEC2D-DIV</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-DIV V SCALAR)
</pre></div>


<p>Divide the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2d-div-function_1"><code>VEC2D-DIV!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-DIV! V SCALAR)
</pre></div>


<p>Destructively divide the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2d-eql-function"><code>VEC2D-EQL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-EQL V1 V2 &amp;OPTIONAL EPSILON)
</pre></div>


<p>Return whether <code>v1</code> and <code>v2</code> are componentwise <code>=</code>.</p>
<div class="codehilite"><pre>      If `epsilon` is given, this instead checks that each pair of
      components are within `epsilon` of each other.
</pre></div>


<h3 id="vec2d-length-function"><code>VEC2D-LENGTH</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-LENGTH V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2d-magdir-function"><code>VEC2D-MAGDIR</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-MAGDIR MAGNITUDE DIRECTION)
</pre></div>


<p>Create a fresh vector with the given <code>magnitude</code> and <code>direction</code>.</p>
<h3 id="vec2d-magnitude-function"><code>VEC2D-MAGNITUDE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-MAGNITUDE V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2d-mul-function"><code>VEC2D-MUL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-MUL V SCALAR)
</pre></div>


<p>Multiply the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2d-mul-function_1"><code>VEC2D-MUL!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-MUL! V SCALAR)
</pre></div>


<p>Destructively multiply the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2d-sub-function"><code>VEC2D-SUB</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-SUB V1 V2)
</pre></div>


<p>Subtract <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2d-sub-function_1"><code>VEC2D-SUB!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-SUB! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by subtracting <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2d-sub-function_2"><code>VEC2D-SUB*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-SUB* V X Y)
</pre></div>


<p>Subtract <code>x</code> and <code>y</code> from the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2d-sub-function_3"><code>VEC2D-SUB*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-SUB*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by subtracting <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2d-unit-x-function"><code>VEC2D-UNIT-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-UNIT-X)
</pre></div>


<p>Return a unit vector in the X direction.</p>
<h3 id="vec2d-unit-y-function"><code>VEC2D-UNIT-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-UNIT-Y)
</pre></div>


<p>Return a unit vector in the Y direction.</p>
<h3 id="vec2d-x-function"><code>VEC2D-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-X VALUE INSTANCE)
</pre></div>


<h3 id="vec2d-xy-function"><code>VEC2D-XY</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-XY V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2d</code> of its <code>x</code> and <code>y</code> components.</p>
<h3 id="vec2d-xy-function_1"><code>VEC2D-XY!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-XY! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>x</code> and <code>y</code>.</p>
<h3 id="vec2d-y-function"><code>VEC2D-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-Y VALUE INSTANCE)
</pre></div>


<h3 id="vec2d-yx-function"><code>VEC2D-YX</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-YX V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2d</code> of its <code>y</code> and <code>x</code> components.</p>
<h3 id="vec2d-yx-function_1"><code>VEC2D-YX!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-YX! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>y</code> and <code>x</code>.</p>
<h3 id="vec2d-zero-function"><code>VEC2D-ZERO</code> (function)</h3>
<div class="codehilite"><pre>(VEC2D-ZERO)
</pre></div>


<p>Return a fresh zero vector.</p>
<h3 id="vec2f-struct"><code>VEC2F</code> (struct)</h3>
<p>A two-dimensional vector of <code>SINGLE-FLOAT</code>s.</p>
<p>Slots: <code>X</code>, <code>Y</code></p>
<h3 id="vec2f-add-function"><code>VEC2F-ADD</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ADD V1 V2)
</pre></div>


<p>Add <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2f-add-function_1"><code>VEC2F-ADD!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ADD! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by adding <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2f-add-function_2"><code>VEC2F-ADD*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ADD* V X Y)
</pre></div>


<p>Add <code>x</code> and <code>y</code> to the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2f-add-function_3"><code>VEC2F-ADD*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ADD*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by adding <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2f-angle-function"><code>VEC2F-ANGLE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ANGLE V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2f-direction-function"><code>VEC2F-DIRECTION</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-DIRECTION V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2f-div-function"><code>VEC2F-DIV</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-DIV V SCALAR)
</pre></div>


<p>Divide the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2f-div-function_1"><code>VEC2F-DIV!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-DIV! V SCALAR)
</pre></div>


<p>Destructively divide the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2f-eql-function"><code>VEC2F-EQL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-EQL V1 V2 &amp;OPTIONAL EPSILON)
</pre></div>


<p>Return whether <code>v1</code> and <code>v2</code> are componentwise <code>=</code>.</p>
<div class="codehilite"><pre>      If `epsilon` is given, this instead checks that each pair of
      components are within `epsilon` of each other.
</pre></div>


<h3 id="vec2f-length-function"><code>VEC2F-LENGTH</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-LENGTH V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2f-magdir-function"><code>VEC2F-MAGDIR</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-MAGDIR MAGNITUDE DIRECTION)
</pre></div>


<p>Create a fresh vector with the given <code>magnitude</code> and <code>direction</code>.</p>
<h3 id="vec2f-magnitude-function"><code>VEC2F-MAGNITUDE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-MAGNITUDE V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2f-mul-function"><code>VEC2F-MUL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-MUL V SCALAR)
</pre></div>


<p>Multiply the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2f-mul-function_1"><code>VEC2F-MUL!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-MUL! V SCALAR)
</pre></div>


<p>Destructively multiply the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2f-sub-function"><code>VEC2F-SUB</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-SUB V1 V2)
</pre></div>


<p>Subtract <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2f-sub-function_1"><code>VEC2F-SUB!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-SUB! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by subtracting <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2f-sub-function_2"><code>VEC2F-SUB*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-SUB* V X Y)
</pre></div>


<p>Subtract <code>x</code> and <code>y</code> from the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2f-sub-function_3"><code>VEC2F-SUB*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-SUB*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by subtracting <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2f-unit-x-function"><code>VEC2F-UNIT-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-UNIT-X)
</pre></div>


<p>Return a unit vector in the X direction.</p>
<h3 id="vec2f-unit-y-function"><code>VEC2F-UNIT-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-UNIT-Y)
</pre></div>


<p>Return a unit vector in the Y direction.</p>
<h3 id="vec2f-x-function"><code>VEC2F-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-X VALUE INSTANCE)
</pre></div>


<h3 id="vec2f-xy-function"><code>VEC2F-XY</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-XY V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2f</code> of its <code>x</code> and <code>y</code> components.</p>
<h3 id="vec2f-xy-function_1"><code>VEC2F-XY!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-XY! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>x</code> and <code>y</code>.</p>
<h3 id="vec2f-y-function"><code>VEC2F-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-Y VALUE INSTANCE)
</pre></div>


<h3 id="vec2f-yx-function"><code>VEC2F-YX</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-YX V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2f</code> of its <code>y</code> and <code>x</code> components.</p>
<h3 id="vec2f-yx-function_1"><code>VEC2F-YX!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-YX! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>y</code> and <code>x</code>.</p>
<h3 id="vec2f-zero-function"><code>VEC2F-ZERO</code> (function)</h3>
<div class="codehilite"><pre>(VEC2F-ZERO)
</pre></div>


<p>Return a fresh zero vector.</p>
<h3 id="vec2i-struct"><code>VEC2I</code> (struct)</h3>
<p>A two-dimensional vector of <code>FIXNUM</code>s.</p>
<p>Slots: <code>X</code>, <code>Y</code></p>
<h3 id="vec2i-add-function"><code>VEC2I-ADD</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ADD V1 V2)
</pre></div>


<p>Add <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2i-add-function_1"><code>VEC2I-ADD!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ADD! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by adding <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2i-add-function_2"><code>VEC2I-ADD*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ADD* V X Y)
</pre></div>


<p>Add <code>x</code> and <code>y</code> to the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2i-add-function_3"><code>VEC2I-ADD*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ADD*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by adding <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2i-angle-function"><code>VEC2I-ANGLE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ANGLE V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2i-direction-function"><code>VEC2I-DIRECTION</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-DIRECTION V)
</pre></div>


<p>Return the angle of <code>v</code>.</p>
<h3 id="vec2i-div-function"><code>VEC2I-DIV</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-DIV V SCALAR)
</pre></div>


<p>Divide the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2i-div-function_1"><code>VEC2I-DIV!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-DIV! V SCALAR)
</pre></div>


<p>Destructively divide the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2i-eql-function"><code>VEC2I-EQL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-EQL V1 V2 &amp;OPTIONAL EPSILON)
</pre></div>


<p>Return whether <code>v1</code> and <code>v2</code> are componentwise <code>=</code>.</p>
<div class="codehilite"><pre>      If `epsilon` is given, this instead checks that each pair of
      components are within `epsilon` of each other.
</pre></div>


<h3 id="vec2i-length-function"><code>VEC2I-LENGTH</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-LENGTH V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2i-magdir-function"><code>VEC2I-MAGDIR</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-MAGDIR MAGNITUDE DIRECTION)
</pre></div>


<p>Create a fresh vector with the given <code>magnitude</code> and <code>direction</code>.</p>
<h3 id="vec2i-magnitude-function"><code>VEC2I-MAGNITUDE</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-MAGNITUDE V)
</pre></div>


<p>Return the magnitude of <code>v</code>.</p>
<h3 id="vec2i-mul-function"><code>VEC2I-MUL</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-MUL V SCALAR)
</pre></div>


<p>Multiply the components of <code>v</code> by <code>scalar</code>, returning a new vector.</p>
<h3 id="vec2i-mul-function_1"><code>VEC2I-MUL!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-MUL! V SCALAR)
</pre></div>


<p>Destructively multiply the components of <code>v</code> by <code>scalar</code>, returning <code>v</code>.</p>
<h3 id="vec2i-sub-function"><code>VEC2I-SUB</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-SUB V1 V2)
</pre></div>


<p>Subtract <code>v1</code> and <code>v2</code> componentwise, returning a new vector.</p>
<h3 id="vec2i-sub-function_1"><code>VEC2I-SUB!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-SUB! V1 V2)
</pre></div>


<p>Destructively update <code>v1</code> by subtracting <code>v2</code> componentwise, returning <code>v1</code>.</p>
<h3 id="vec2i-sub-function_2"><code>VEC2I-SUB*</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-SUB* V X Y)
</pre></div>


<p>Subtract <code>x</code> and <code>y</code> from the components of <code>v</code>, returning a new vector.</p>
<h3 id="vec2i-sub-function_3"><code>VEC2I-SUB*!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-SUB*! V X Y)
</pre></div>


<p>Destructively update <code>v</code> by subtracting <code>x</code> and <code>y</code>, returning <code>v</code>.</p>
<h3 id="vec2i-unit-x-function"><code>VEC2I-UNIT-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-UNIT-X)
</pre></div>


<p>Return a unit vector in the X direction.</p>
<h3 id="vec2i-unit-y-function"><code>VEC2I-UNIT-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-UNIT-Y)
</pre></div>


<p>Return a unit vector in the Y direction.</p>
<h3 id="vec2i-x-function"><code>VEC2I-X</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-X VALUE INSTANCE)
</pre></div>


<h3 id="vec2i-xy-function"><code>VEC2I-XY</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-XY V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2i</code> of its <code>x</code> and <code>y</code> components.</p>
<h3 id="vec2i-xy-function_1"><code>VEC2I-XY!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-XY! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>x</code> and <code>y</code>.</p>
<h3 id="vec2i-y-function"><code>VEC2I-Y</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-Y VALUE INSTANCE)
</pre></div>


<h3 id="vec2i-yx-function"><code>VEC2I-YX</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-YX V)
</pre></div>


<p>Swizzle <code>v</code>, returning a new <code>vec2i</code> of its <code>y</code> and <code>x</code> components.</p>
<h3 id="vec2i-yx-function_1"><code>VEC2I-YX!</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-YX! V)
</pre></div>


<p>Swizzle <code>v</code> in-place and return it, setting its components to <code>y</code> and <code>x</code>.</p>
<h3 id="vec2i-zero-function"><code>VEC2I-ZERO</code> (function)</h3>
<div class="codehilite"><pre>(VEC2I-ZERO)
</pre></div>


<p>Return a fresh zero vector.</p>
                </div>
            <footer><p><i>Made with Lisp and love by <a href="http://stevelosh.com/">Steve Losh</a> in Reykjavík, Iceland.</i></p>
<script>
  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

  ga('create', 'UA-15328874-3', 'auto');
  ga('send', 'pageview');

</script></footer>
        </div>
    </body>
</html>