# The vectors Reference Manual

Next: , Previous: , Up: (dir)   [Contents][Index]

# The vectors Reference Manual

This is the vectors Reference Manual, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:44:39 2018 GMT+0.

Next: , Previous: , Up: Top   [Contents][Index]

# Some utilities for vectors

All these functions are inside of package `#:vec`

## Constructing and destructing vectors

Function

`vector-of type &rest elemnets`

Create a vector of type `type` containing `elements`.

Function

`slice vector &optional start end`

Create a slice of a `vector`, which is a subvector from `start` to `end` of `vector` and points to the same entries as `vector`.

Macro

`vector-bind list vec &body body`

`list`: A variable list

`vec`: A vector

Bind elements of `vec` to variables in `list`.

## Setting and creating vectors

Function

`mapvs size function vec &rest vecs`

For the first `size` entries of `vec` and `vecs` call `function` on an element at the same position and write it at the same position of `vec`.

Function

`mapvec function vec &rest vecs`

Same as `apply #'map 'vector vec vecs`.

Function

`mapv function vec &rest vecs`

Same as `apply #'map-into vec vecs`.

Function

`vec-copy vec`

Create a new vector with the same contents as `vec`.

Function

`setv vec vec0`

Set all elements of `vec` to `vec0` without creating a new vector.

# Math functions

## Simple math

In following each pair of functions do the same, but the first version of the function create a new vector, the second write the result to the first vector.

Addition and subtraction only take vectors as arguments, multiplication and division only take a vector for the first argument.

``````;;Addition
v+
incv
;;Subtraction
v-
decv
;;Multiplication
v*
mulv
;;Division
v/
divv
``````

## Vector specific math

Function

`absvec vec`

The length of the vector `vec`.

Function

`normalize vec`

Normalize the vector `vec` and get it.

Function

`unitvec vec`

A new unit vector with the direction of `vec`. Same as `(normalize (copy-vec vec))`.

Function

`distance vec vec0`

Distance between the vectors `vec` and `vec0`

Function

`scalar vec vec0`

The scalar product of `vec` and `vec0`.

Function

`unit-scalar vec vec0`

Optimized version of `(scalar (unitvec vec) (unitvec vec0))`.

Function

`angle vec vec0`

Angle between `vec` and `vec0`.

Function

`cross3 vec vec0`

Cross product of the 3D-vectors `vec` and `vec0`.

# Some other functions

``````orthogonal-factor
orthogonal-vector
line-vector
line-distance
``````

Next: , Previous: , Up: Top   [Contents][Index]

## 2 Systems

The main system appears first, followed by any subsystem dependency.

Previous: , Up: Systems   [Contents][Index]

### 2.1 vectors

Author

Fabio Krapohl <fabio.u.krapohl@fau.de>

LLGPL

Description

Some utilities for using vectors

Source

vectors.asd (file)

Component

vectors.lisp (file)

Next: , Previous: , Up: Top   [Contents][Index]

## 3 Files

Files are sorted by type and then listed depth-first from the systems components trees.

Previous: , Up: Files   [Contents][Index]

### 3.1 Lisp

Next: , Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.1 vectors.asd

Location

vectors.asd

Systems

vectors (system)

Previous: , Up: Lisp files   [Contents][Index]

#### 3.1.2 vectors/vectors.lisp

Parent

vectors (system)

Location

vectors.lisp

Packages
Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

## 4 Packages

Packages are listed by definition order.

Previous: , Up: Packages   [Contents][Index]

### 4.1 vec

Source

vectors.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

## 5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.

Next: , Previous: , Up: Definitions   [Contents][Index]

### 5.1 Exported definitions

Next: , Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.1 Macros

Macro: vector-bind LIST VEC &body BODY
Package
Source

vectors.lisp (file)

Previous: , Up: Exported definitions   [Contents][Index]

#### 5.1.2 Functions

Function: absvec VECTOR
Package
Source

vectors.lisp (file)

Function: angle VECA VECD
Package
Source

vectors.lisp (file)

Function: cross3 VECA VECD
Package
Source

vectors.lisp (file)

Function: decv &rest VECTORS
Package
Source

vectors.lisp (file)

Function: distance VECTORA VECTORD
Package
Source

vectors.lisp (file)

Function: divv VECTOR &rest NUMBERS
Package
Source

vectors.lisp (file)

Function: incv &rest VECTORS
Package
Source

vectors.lisp (file)

Function: line-distance POINT LINE
Package
Source

vectors.lisp (file)

Function: line-vector POINT LINE
Package
Source

vectors.lisp (file)

Function: mapv FUNCTION VEC &rest VECS
Package
Source

vectors.lisp (file)

Function: mapvec FUNCTION VEC &rest VECS
Package
Source

vectors.lisp (file)

Function: mapvs SIZE FUNCTION VEC &rest VECS
Package
Source

vectors.lisp (file)

Function: mulv VECTOR &rest NUMBERS
Package
Source

vectors.lisp (file)

Function: normalize VECTOR
Package
Source

vectors.lisp (file)

Function: orthogonal-factor POINT LINE
Package
Source

vectors.lisp (file)

Function: orthogonal-vector POINT LINE
Package
Source

vectors.lisp (file)

Function: scalar VECTORA VECTORD
Package
Source

vectors.lisp (file)

Function: setv VECA VECD
Package
Source

vectors.lisp (file)

Function: slice VECTOR &optional START END &aux LEN
Package
Source

vectors.lisp (file)

Function: unit-scalar VECA VECD
Package
Source

vectors.lisp (file)

Function: unitvec VECTOR
Package
Source

vectors.lisp (file)

Function: v* VECTOR &rest NUMBERS
Package
Source

vectors.lisp (file)

Function: v+ &rest VECTORS
Package
Source

vectors.lisp (file)

Function: v- &rest VECTORS
Package
Source

vectors.lisp (file)

Function: v/ VECTOR &rest NUMBERS
Package
Source

vectors.lisp (file)

Function: vec-copy VEC
Package
Source

vectors.lisp (file)

Function: vector-of TYPE &rest ELEMENTS
Package
Source

vectors.lisp (file)

Previous: , Up: Definitions   [Contents][Index]

### 5.2 Internal definitions

Previous: , Up: Internal definitions   [Contents][Index]

#### 5.2.1 Macros

Macro: mapfun ARGS &body BODY
Package
Source

vectors.lisp (file)

Macro: vector-function FO FI VAR
Package
Source

vectors.lisp (file)

Previous: , Up: Top   [Contents][Index]

## Appendix A Indexes

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.1 Concepts

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.2 Functions

Jump to: A   C   D   F   I   L   M   N   O   S   U   V
Jump to: A   C   D   F   I   L   M   N   O   S   U   V

Next: , Previous: , Up: Indexes   [Contents][Index]

### A.3 Variables

Previous: , Up: Indexes   [Contents][Index]

### A.4 Data types

Index Entry Section `Package, vec`: The vec package `System, vectors`: The vectors system `vec`: The vec package `vectors`: The vectors system