Skip to content
ExamplesOpen editor ↗

ribegaMola

Reflects a vector about a surface.

ribegaMola(mola, oMongwe)

Mutates and returns the first vector after reflecting it about a line in 2D or plane in 3D. Pass the surface normal, perpendicular to that surface. It need not have magnitude 1 and is not changed. A zero normal leaves the first vector unchanged.

NameTypeDescription
molamolaThe first vector.
oMongwemolaThe surface normal.
Reflects a vector about a surface
tiro setaLoeto() {
  thalaKanefase(320, 220);
  bokamorago(235);
  diri a = bopaMola(3, 4);
  diri b = bopaMola(5, 1);
  diri sephetho = ribegaMola(a, bopaMola(0, 1));
  atisaMola(sephetho, 20);
  thalaMothalo(90, 60, 90 + sephetho.x, 60 + sephetho.y);
  emisaPoapoeletso();
}

bopaMola, kopololaMola