Skip to content

textmode.js / TextmodeVector / setMag

Method: setMag()

ts
setMag(magnitude): this;

Set this vector's magnitude.

Zero vectors remain unchanged because they have no direction to preserve.

Parameters

ParameterTypeDescription
magnitudenumberNew magnitude.

Returns

this

This vector.

Example