Skip to content
ExamplesOpen editor ↗

pharologanyoYaMela

Returns the difference of two vectors.

pharologanyoYaMela(a, b, [lefelobokelo])

Computes a - b component by component and returns a new vector, leaving both inputs unchanged. If a destination vector is supplied, writes into and returns that destination. A destination that aliases either input changes that input. Use vectors with matching dimensions.

NameTypeDescription
amolaFirst vector.
bmolaSecond vector.
lefelobokelo (optional)molaOptional destination vector; returned instead of allocating a new vector.
Returns the difference of two vectors
tiro setaLoeto() {
  thalaKanefase(320, 220);
  bokamorago(235);
  diri a = bopaMola(110, 70);
  diri b = bopaMola(45, 25);
  diri c = pharologanyoYaMela(a, b);
  sutisa(60, 50);
  mothaloMmala(100);
  thalaMothalo(0, 0, a.x, a.y);
  mothaloMmala(30, 130, 160);
  thalaMothalo(0, 0, c.x, c.y);
  emisaPoapoeletso();
}

bopaMola, ntshaMoMoleng