cos |
Cosinus |
---|---|
Java | java.lang |
Math |
Syntaxe
static double cos(double a); |
Paramètres
Nom | Description |
---|---|
a | Ce paramètre permet d'indiquer l'expression contenant le nombre à traiter. |
Description
Cette méthode trigonométrique retourne le «Cosinus».
Algorithme
MODULE COS(X) R ← X x X S ← 42.0 BOUCLE POUR I ← 10 JUSQU'A 1 S ← 4.0 x I - 2.0 + (-R) / S FIN BOUCLE POUR S ← S x S RETOURNE (S - R) / (S + R) |
Exemple
Voici un exemple permet d'afficher les Cosinus inférieurs à π :
on obtiendra le résultat suivant :
Cos(0.0)=1.0Cos(0.1)=0.9950041652780258
Cos(0.2)=0.9800665778412416
Cos(0.30000000000000004)=0.955336489125606
Cos(0.4)=0.9210609940028851
Cos(0.5)=0.8775825618903728
Cos(0.6)=0.8253356149096783
Cos(0.7)=0.7648421872844885
Cos(0.7999999999999999)=0.6967067093471655
Cos(0.8999999999999999)=0.6216099682706645
Cos(0.9999999999999999)=0.5403023058681398
Cos(1.0999999999999999)=0.4535961214255775
Cos(1.2)=0.3623577544766736
Cos(1.3)=0.26749882862458735
Cos(1.4000000000000001)=0.16996714290024081
Cos(1.5000000000000002)=0.07073720166770268
Cos(1.6000000000000003)=-0.029199522301289037
Cos(1.7000000000000004)=-0.12884449429552508
Cos(1.8000000000000005)=-0.22720209469308753
Cos(1.9000000000000006)=-0.32328956686350396
Cos(2.0000000000000004)=-0.4161468365471428
Cos(2.1000000000000005)=-0.5048461045998579
Cos(2.2000000000000006)=-0.5885011172553463
Cos(2.3000000000000007)=-0.6662760212798248
Cos(2.400000000000001)=-0.7373937155412461
Cos(2.500000000000001)=-0.8011436155469343
Cos(2.600000000000001)=-0.8568887533689478
Cos(2.700000000000001)=-0.9040721420170617
Cos(2.800000000000001)=-0.9422223406686585
Cos(2.9000000000000012)=-0.9709581651495908
Cos(3.0000000000000013)=-0.9899924966004456
Cos(3.1000000000000014)=-0.9991351502732795
Dernière mise à jour : Dimanche, le 21 juin 2015