Skip to content
ExamplesOpen editor ↗

magarengMelaKaSekhutlo

Interpolates vector direction and magnitude.

magarengMelaKaSekhutlo(mola, oMongwe, seelo)

Mutates and returns the first vector, interpolating direction along an arc and magnitude along a straight scale. Amount 0 keeps the start; 1 reaches the destination. Zero-length inputs use component interpolation. The second vector is unchanged.

NameTypeDescription
molamolaThe first vector.
oMongwemolaThe second vector.
seelopaloInterpolation amount; 0 is the start and 1 is the end.
Interpolates vector direction and magnitude
tiro setaLoeto() {
  thalaKanefase(320, 220);
  bokamorago(235);
  diri a = bopaMola(3, 4);
  diri b = bopaMola(5, 1);
  diri sephetho = magarengMelaKaSekhutlo(a, b, 0.5);
  atisaMola(sephetho, 20);
  thalaMothalo(90, 60, 90 + sephetho.x, 60 + sephetho.y);
  emisaPoapoeletso();
}

bopaMola, kopololaMola