bayaBoleeleJwaMola
Sets a vector’s magnitude.
bayaBoleeleJwaMola(mola, boleeleJoBosha)Changes the magnitude while preserving direction. Supply a nonnegative length. A zero vector remains zero because it has no direction. Mutates and returns the first vector.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
mola | mola | The vector to change. |
boleeleJoBosha | palo | A nonnegative magnitude. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri lebelo = bopaMola(150, 90);
bayaBoleeleJwaMola(lebelo, 90);
thalaMothalo(40, 40, 40 + lebelo.x, 40 + lebelo.y);
thalaSediko(40 + lebelo.x, 40 + lebelo.y, 12);
emisaPoapoeletso();
}