Module

# GLMatrix.Vec3

Package
purescript-gl-matrix
Repository
dirkz/purescript-gl-matrix

### #Vec3Source

``data Vec3 :: Type``

#### Instances

• `Show Vec3`
• `Eq Vec3`

``add :: Vec3 -> Vec3 -> Vec3``

### #angleSource

``angle :: Vec3 -> Vec3 -> Number``

Get the angle between two 2D vectors

### #bezierSource

``bezier :: Vec3 -> Vec3 -> Vec3 -> Vec3 -> Number -> Vec3``

Performs a bezier interpolation with two control points

### #ceilSource

``ceil :: Vec3 -> Vec3``

Math.ceil the components of a Vec3

### #crossSource

``cross :: Vec3 -> Vec3 -> Vec3``

### #distanceSource

``distance :: Vec3 -> Vec3 -> Number``

Calculates the euclidian distance between two Vec3's

### #divideSource

``divide :: Vec3 -> Vec3 -> Vec3``

Divides two Vec3's

### #dotSource

``dot :: Vec3 -> Vec3 -> Number``

Calculates the dot product of two Vec3's

### #equalsSource

``equals :: Vec3 -> Vec3 -> Boolean``

Returns whether or not the vectors have approximately the same elements in the same position

### #floorSource

``floor :: Vec3 -> Vec3``

Math.floor the components of a Vec3

### #fromValuesSource

``fromValues :: Number -> Number -> Number -> Vec3``

Creates a new Vec3 initialized with the given values

### #hermiteSource

``hermite :: Vec3 -> Vec3 -> Vec3 -> Vec3 -> Number -> Vec3``

Performs a hermite interpolation with two control points

### #inverseSource

``inverse :: Vec3 -> Vec3``

Returns the inverse of the components of a Vec3

### #lengthSource

``length :: Vec3 -> Number``

Calculates the length of a Vec3

### #lerpSource

``lerp :: Vec3 -> Vec3 -> Number -> Vec3``

Performs a linear interpolation between two Vec3's

### #maxSource

``max :: Vec3 -> Vec3 -> Vec3``

Returns the maximum of two Vec3's

### #minSource

``min :: Vec3 -> Vec3 -> Vec3``

Returns the minimum of two Vec3's

### #multiplySource

``multiply :: Vec3 -> Vec3 -> Vec3``

Multiplies two Vec3's

### #negateSource

``negate :: Vec3 -> Vec3``

Negates the components of a Vec3

### #normalizeSource

``normalize :: Vec3 -> Vec3``

Normalize a Vec3

### #rotateXSource

``rotateX :: Vec3 -> Vec3 -> Number -> Vec3``

Rotate a 3D vector around the x-axis

### #rotateYSource

``rotateY :: Vec3 -> Vec3 -> Number -> Vec3``

Rotate a 3D vector around the y-axis

### #rotateZSource

``rotateZ :: Vec3 -> Vec3 -> Number -> Vec3``

Rotate a 3D vector around the z-axis

### #roundSource

``round :: Vec3 -> Vec3``

Math.round the components of a Vec3

### #scaleSource

``scale :: Vec3 -> Number -> Vec3``

Scales a Vec3 by a scalar number

``scaleAndAdd :: Vec3 -> Vec3 -> Number -> Vec3``

Adds two Vec3's after scaling the second operand by a scalar value

### #squaredDistanceSource

``squaredDistance :: Vec3 -> Vec3 -> Number``

Calculates the squared euclidian distance between two Vec3's

### #squaredLengthSource

``squaredLength :: Vec3 -> Number``

Calculates the squared length of a Vec3

### #subtractSource

``subtract :: Vec3 -> Vec3 -> Vec3``

Subtracts vector b from vector a

### #zeroSource

``zero :: Vec3``

``numbers :: Vec3 -> Array Number``

Extract a number array

### #mapSource

``map :: (Number -> Number) -> Vec3 -> Vec3``

Map a function from `Number` to `Number` over it. Note: Since this is not a general container, it cannot be a `Functor`.

``unsafeFromNumbers :: Partial => Array Number -> Vec3``

Create a vector from an array produced by `numbers`.

### #zipWithSource

``zipWith :: (Number -> Number -> Number) -> Vec3 -> Vec3 -> Vec3``

### #sliceSource

``slice :: Int -> Int -> Vec3 -> Array Number``

Like `Array.slice`