C/acos: Różnice pomiędzy wersjami

Usunięta treść Dodana treść
Mina86 (dyskusja | edycje)
Połączony opis funkcji trygonometrycznych i hiperbolicznych; Dokładniejszy opis i przykład
Lethern (dyskusja | edycje)
Linia 94:
 
=== Przykład użycia ===
<source lang="c">
 
#include <math.h>
#include <stdio.h>
/* Program oblicza wychylenie, prędkość i przyśpieszenie
ciała, gdy drga ono harmonicznie */
int main(void)
{
double A, omega, t, x, V, a;
printf("A = ");
if (scanf("%lf", &A) != 1) return 1;
printf("omega = ");
if (scanf("%lf", &omega) != 1) return 1;
printf("t = ");
if (scanf("%lf", &t) != 1) return 1;
x = A * sin(omega * t);
V = A * omega * cos(omega * t);
a = - omega * omega * x;
printf("x = %f\nV = %f\na = %f\n", x, V, a);
return 0;
}
</source>
 
=== Uwagi ===