Skip to content

Documentation / Vec2 / mapVec

mapVec() ​

ts
function mapVec(v, func): Vec2;

Defined in: Utils/vec2.ts:214

Calls a function func on each component of a vector, creating a new vector from the result of each function call.

Parameters ​

v ​

Vec2

func ​

(xOrY) => number

Returns ​

Vec2

A new vector.