Skip to content
ExamplesOpen editor ↗

thalaBezier

→ bezier()

Draws a Bézier curve from four points — two ends and two control points.

thalaBezier(x1, y1, x2, y2, x3, y3, x4, y4)

thalaBezier(x1, y1, x2, y2, x3, y3, x4, y4) draws a curve between two end points, pulled about by two control points the line never reaches.

The first two numbers are the point the line starts at. The next four are the control points — they pull the line towards them, and the line does not touch them. The last two are the point the line ends at.

The Bézier name is not translated. Pierre Bézier was a person — a car engineer in France — and people’s names are not translated. It is the same rule that leaves paloEpeGauss as it is.

The gentler curve is thalaKonego, which passes through every point you give it instead of merely being pulled by them.

⚠ With both the stroke and the fill turned off, nothing happens at all — thalaBezier simply falls silent rather than throwing. Measured.

NameTypeDescription
x1palox of the first anchor point.
y1paloy of the first anchor point.
x2palox of the first control point.
y2paloy of the first control point.
x3palox of the second control point.
y3paloy of the second control point.
x4palox of the second anchor point.
y4paloy of the second anchor point.
A curve with its control points shown
tiro setaLoeto() {
  thalaKanefase(400, 260);
  bokamorago(245);

  // Mothalo o o bontshang kwa dintlha tsa taolo di leng teng
  mothaloMmala(200, 200, 200);
  boketeMothalo(1);
  thalaMothalo(60, 200, 120, 40);
  thalaMothalo(340, 200, 280, 40);

  tlogelaGoTlatsa();
  mothaloMmala(30, 90, 170);
  boketeMothalo(4);
  thalaBezier(60, 200, 120, 40, 280, 40, 340, 200);

  tlogelaMothalo();
  tlatsaMmala(220, 70, 90);
  thalaNtlha(120, 40);
  thalaNtlha(280, 40);

  tlhalosa('Konego ya botala jwa loapi e e menaganeng, le mela e mebedi e e bofefo e e supang dintlha tsa taolo tse dikhibidu tse konego e sa di kgomeng.');
}

ntlhanaBezier, magarengBezier, mothalokgomiBezier, thalaKonego