bayaBoleeleBongwe
Normalizes a vector to magnitude 1.
bayaBoleeleBongwe(mola)Preserves direction and changes the magnitude to 1. A zero vector stays zero. Mutates and returns the first vector.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
mola | mola | The vector to change. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri lebelo = bopaMola(150, 90);
bayaBoleeleBongwe(lebelo);
atisaMola(lebelo, 90);
thalaMothalo(40, 40, 40 + lebelo.x, 40 + lebelo.y);
thalaSediko(40 + lebelo.x, 40 + lebelo.y, 12);
emisaPoapoeletso();
}