# Particulate.js0.3.3

## Vec3

Vector utilities.

`angle`( `b0, ai, bi, ci` ) static Float

Calculate angle between segments `ab` and `bc`

• `b0` Array

Vec3 buffer

• `ai` Int

Vector index a

• `bi` Int

Vector index b

• `ci` Int

Vector index c

Returns: Float

`copy`( `b0, ai, out` ) static
• `b0` Array

Vec3 buffer

• `ai` Int

Vector index

• `out` Array

Destination vector

`create`( `positions` ) static Float32Array
• `positions` Int | Array

Number of vectors or array of initial values

Returns: Float32Array

Vec3 buffer

`distance`( `b0, ai, bi` ) static Float
• `b0` Array

Vec3 buffer

• `ai` Int

Vector index a

• `bi` Int

Vector index b

Returns: Float

Distance from a to b

`distanceSq`( `b0, ai, bi` ) static Float
• `b0` Array

Vec3 buffer

• `ai` Int

Vector index a

• `bi` Int

Vector index b

Returns: Float

Squared distance from a to b

`length`( `b0, ai` ) static Float
• `b0` Array

Vec3 buffer

• `ai` Int

Vector index

Returns: Float

Length of vector

`lengthSq`( `b0, ai` ) static Float
• `b0` Array

Vec3 buffer

• `ai` Int

Vector index

Returns: Float

Squared length of vector

`normalize`( `b0, ai` ) static

Normalize vector in place

• `b0` Array

Vec3 buffer

• `ai` Int

Vector index a

`set`( `b0, i, x, [y], [z]` ) static

Set single vector in buffer

• `b0` Array

Vec3 buffer

• `i` Int

Vector index

• `x` Array | Float

Vector or x component value

• `[y]` Float
• `[z]` Float