Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

translate a vector

/**
 * @function translateVector
 * @param {Vector} vector 
 * @param {Vector} translation 
 * @returns {Vector}
 * @description Translates a vector by a vector
 */
export function translateVector(vector: Vector, translation: Vector): Vector {
    return new Vector(vector.x + translation.x, vector.y + translation.y)
}
 
PREVIOUS NEXT
Tagged: #translate #vector
ADD COMMENT
Topic
Name
5+1 =