# Class: vec2

## vec2

2 Dimensional Vector

## Constructor

#### new vec2()

Source:
  - vec2.js, line 23

### Methods

#### (static) dist()

Alias for vec2.distance

Source:
  - vec2.js, line 532

#### (static) div()

Alias for vec2.divide

Source:
  - vec2.js, line 526

#### (static) forEach(a, stride, offset, count, fn, argopt) → {Array}

Perform some operation over an array of vec2s.

##### Parameters:

Name | Type | Attributes | Description
--- | --- | --- | ---
`a` | Array |  | the array of vectors to iterate over
`stride` | Number |  | Number of elements between the start of each vec2. If 0 assumes tightly packed
`offset` | Number |  | Number of elements to skip at the beginning of the array
`count` | Number |  | Number of vec2s to iterate over. If 0 iterates over entire array
`fn` | function |  | Function to call for each vector in the array
`arg` | Object | <optional> | additional argument to pass to fn

Source:
  - vec2.js, line 558

##### Returns:

a

Type
  Array

#### (static) length()

Alias for vec2.length

Source:
  - vec2.js, line 508

#### (static) mul()

Alias for vec2.multiply

Source:
  - vec2.js, line 520

#### (static) sqrDist()

Alias for vec2.squaredDistance

Source:
  - vec2.js, line 538

#### (static) sqrLen()

Alias for vec2.squaredLength

Source:
  - vec2.js, line 544

#### (static) sub()

Alias for vec2.subtract

Source:
  - vec2.js, line 514