bayaSekhutloSaMola
Sets a vector’s heading.
bayaSekhutloSaMola(mola, sekhutlo)Mutates and returns the vector while preserving magnitude. Use a 2D vector with z equal to 0. A vector from bopaMola follows seeloSaSekhutlo; vectors from molaWaSekhutlo and molaOpe use radians.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
mola | mola | The first vector. |
sekhutlo | palo | The new heading. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri a = bopaMola(3, 4);
diri b = bopaMola(5, 1);
diri sephetho = bayaSekhutloSaMola(a, PI / 4);
atisaMola(sephetho, 20);
thalaMothalo(90, 60, 90 + sephetho.x, 60 + sephetho.y);
emisaPoapoeletso();
}