random(scale = 1.0)
    {
        const r = Math.random() * 2.0 * Math.PI;

        this.x = Math.cos(r) * scale;
        this.y = Math.sin(r) * scale;

        return this;
    }
/**
     * Sets the components to random numbers with the given scale.
     *
     * @param {number} scale - Length of the resulting vector. If ommitted, a unit vector will be returned.
     * @return {Vector2d} returns itself.
     */
Sets the components to random numbers with the given scale.
@param {number} scale - Length of the resulting vector. If ommitted, a unit vector will be returned.
@return {Vector2d} returns itself.
Sets the components to random numbers with the given scale . @param { number } scale - Length of the resulting vector . If ommitted a unit vector will be returned . @return { Vector2d } returns itself .
random(scale = 1.0)
    {
        const r = Math.random() * 2.0 * Math.PI;
        this.x = Math.cos(r) * scale;
        this.y = Math.sin(r) * scale;
        return this;
    }
random ( scale = 1.0 ) { const r = Math . random ( ) * 2.0 * Math . PI ; this . x = Math . cos ( r ) * scale ; this . y = Math . sin ( r ) * scale ; return this ; }
Sets the components to random numbers with the given scale.
Sets the components to random numbers with the given scale .