Module

GLMatrix.Vec2

#Vec2

data Vec2 :: Type

Instances

#add

add :: Vec2 -> Vec2 -> Vec2

Adds two vec2's

#angle

angle :: Vec2 -> Vec2 -> Number

Get the angle between two 2D vectors

#ceil

ceil :: Vec2 -> Vec2

Math.ceil the components of a vec2

#cross

cross :: Vec2 -> Vec2 -> Vec3

#distance

distance :: Vec2 -> Vec2 -> Number

Calculates the euclidian distance between two vec2's

#divide

divide :: Vec2 -> Vec2 -> Vec2

Divides two vec2's

#dot

dot :: Vec2 -> Vec2 -> Number

Calculates the dot product of two vec2's

#equals

equals :: Vec2 -> Vec2 -> Boolean

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

#floor

floor :: Vec2 -> Vec2

Math.floor the components of a vec2

#fromValues

fromValues :: Number -> Number -> Vec2

Creates a new vec2 initialized with the given values

#inverse

inverse :: Vec2 -> Vec2

Returns the inverse of the components of a vec2

#length

length :: Vec2 -> Number

Calculates the length of a vec2

#lerp

lerp :: Vec2 -> Vec2 -> Number -> Vec2

Performs a linear interpolation between two vec2's

#max

max :: Vec2 -> Vec2 -> Vec2

Returns the maximum of two vec2's

#min

min :: Vec2 -> Vec2 -> Vec2

Returns the minimum of two vec2's

#multiply

multiply :: Vec2 -> Vec2 -> Vec2

Multiplies two vec2's

#negate

negate :: Vec2 -> Vec2

Negates the components of a vec2

#normalize

normalize :: Vec2 -> Vec2

Normalize a vec2

#rotate

rotate :: Vec2 -> Vec2 -> Number -> Vec2

Rotate a 2D vector

#round

round :: Vec2 -> Vec2

Math.round the components of a vec2

#scale

scale :: Vec2 -> Number -> Vec2

Scales a vec2 by a scalar number

#scaleAndAdd

scaleAndAdd :: Vec2 -> Vec2 -> Number -> Vec2

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

#squaredDistance

squaredDistance :: Vec2 -> Vec2 -> Number

Calculates the squared euclidian distance between two vec2's

#squaredLength

squaredLength :: Vec2 -> Number

Calculates the squared length of a vec2

#subtract

subtract :: Vec2 -> Vec2 -> Vec2

Subtracts vector b from vector a

#transformMat3

transformMat3 :: Vec2 -> Mat3 -> Vec2

Transforms the vec2 with a mat3 3rd vector component is implicitly '1'

#zero

#numbers

numbers :: Vec2 -> Array Number

Extract a number array

#map

map :: (Number -> Number) -> Vec2 -> Vec2

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

#unsafeFromNumbers

unsafeFromNumbers :: Partial => Array Number -> Vec2

Create a vector from an array produced by numbers.

#zipWith

zipWith :: (Number -> Number -> Number) -> Vec2 -> Vec2 -> Vec2

#slice

slice :: Int -> Int -> Vec2 -> Array Number

Like Array.slice

Modules