Skip to content
ExamplesOpen editor ↗

palosekwereYaBoleele

Returns the squared vector magnitude.

palosekwereYaBoleele(mola)

Returns magnitude multiplied by itself without changing the vector. A (3, 4) vector returns 25. This avoids a square root when comparing distances.

NameTypeDescription
molamolaThe first vector.
Returns the squared vector magnitude
tiro setaLoeto() {
  thalaKanefase(320, 220);
  bokamorago(235);
  diri a = bopaMola(3, 4);
  diri b = bopaMola(5, 1);
  diri sephetho = palosekwereYaBoleele(a);
  bogoloJwaMokwalo(28);
  thalaMokwalo(mokwalo(sephetho), 40, 120);
  emisaPoapoeletso();
}

bopaMola, kopololaMola