molaWaSekhutlo
Creates a vector from an angle.
molaWaSekhutlo(sekhutlo, [boleeleJwaOne])Returns a new 2D vector at the supplied angle from the positive x-axis. Magnitude defaults to 1. The input is always in radians, including when seeloSaSekhutlo is DEGREES; the returned vector also rotates in radians.
Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
sekhutlo | palo | Angle in radians. |
boleeleJwaOne (optional) | palo | Magnitude; defaults to 1. |
Examples
Section titled “Examples”tiro setaLoeto() {
thalaKanefase(320, 220);
bokamorago(235);
diri lebelo = molaWaSekhutlo(KOTARA_PI, 100);
thalaMothalo(70, 50, 70 + lebelo.x, 50 + lebelo.y);
emisaPoapoeletso();
}