Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR TYPESCRIPT

scale a vector

/**
 * @function scaleVector
 * @param {Vector} vector 
 * @param {number} scale 
 * @returns {Vector}
 * @description Scales a vector by a factor
 */
export function scaleVector(vector: Vector, scale: number): Vector {
    return new Vector(vector.x * scale, vector.y * scale)
}
 
PREVIOUS NEXT
Tagged: #scale #vector
ADD COMMENT
Topic
Name
8+7 =