mothalokgomiKonego
→ splineTangent()Returns one coordinate on the line that touches a smooth curve.
mothalokgomiKonego(a, b, c, d, t)mothalokgomiKonego(a, b, c, d, t) does what mothalokgomiBezier does, for a thalaKonego curve. It returns the direction the curve is running at that place, one axis at a time.
⚠ Like magarengKonego, t runs from the second point to the third — not from the first to the fourth.
It is useful when you want to turn something to face the way the curve is going — an aeroplane, a fly, or an arrowhead.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
a | palo | Coordinate of the first point. |
b | palo | Coordinate of the second point — this is where t = 0 is. |
c | palo | Coordinate of the third point — this is where t = 1 is. |
d | palo | Coordinate of the fourth point. |
t | palo | How far along you are between the second and third points. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(400, 240);
bokamorago(245);
metlha ax = 30;
metlha ay = 190;
metlha bx = 110;
metlha by = 60;
metlha cx = 290;
metlha cy = 180;
metlha dx = 370;
metlha dy = 50;
tlogelaGoTlatsa();
mothaloMmala(60, 140, 110);
boketeMothalo(3);
thalaKonego(ax, ay, bx, by, cx, cy, dx, dy);
tlogelaMothalo();
tlatsaMmala(220, 70, 90);
gopheta (diri i = 0; i <= 6; i = i + 1) {
metlha t = i / 6;
metlha x = magarengKonego(ax, bx, cx, dx, t);
metlha y = magarengKonego(ay, by, cy, dy, t);
metlha tx = mothalokgomiKonego(ax, bx, cx, dx, t);
metlha ty = mothalokgomiKonego(ay, by, cy, dy, t);
baya();
sutisa(x, y);
dikolosa(atan2(ty, tx));
thalaKhutlotharo(-6, -5, -6, 5, 8, 0);
tsaya();
}
tlhalosa('Konego e talatala e e menaganeng, le dikhutlotharo tse dinnye tse dikhibidu tse supang kwa konego e yang teng mo mafelong a le supa.');
}