downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

cosh> <ceil
[edit] Last updated: Fri, 25 May 2012

view this page in

cos

(PHP 4, PHP 5)

cos余弦(コサイン)

説明

float cos ( float $arg )

cos() は、arg のコサインを 返します。arg はラジアンです。

パラメータ

arg

ラジアンで表した角度。

返り値

arg のコサインを返します。

例1 cos() の例

<?php

echo cos(M_PI); // -1

?>

参考

  • acos() - 逆余弦(アークコサイン)
  • sin() - 正弦(サイン)
  • tan() - 正接(タンジェント)
  • deg2rad() - 度単位の数値をラジアン単位に変換する



cosh> <ceil
[edit] Last updated: Fri, 25 May 2012
 
add a note add a note User Contributed Notes cos
bruha at las wegos dot net 09-Aug-2008 07:45
Another way to figure out a triangle (more efficient)

<?php
$a
= 10; // a
$b = 15; // b

$angle = 45// angle opposite side c

$c = (sqrt(pow($a, 2) + pow($b, 2) - $a * $b * cos(deg2rad($angle)) * 2));

// side c = 10.613894770933
?>

yes im good arent i?
joescuriosityshoppe at gmail dot com 13-Oct-2006 02:55
Find the side of a triangle using two sides and an angle:
<?
$a
= "10"; // length of side a
$b = "15"; // length of side b
$angle = "45"// angle opposite side c

$c = (sqrt(pow($a, 2) + pow($b, 2) - $a * $b * cos(deg2rad($angle)) * 2));

// side c = 10.613894770933
?>
felipensp at gmail dot com 12-Mar-2006 05:29
Convert degree to radianus, radianus to cos.

<?php

   
// Degree
   
$degree = 360;

   
// Convertion
   
print cos(deg2rad($degree));

?>

 
show source | credits | sitemap | contact | advertising | mirror sites