PHP: cos - Manual

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

search for in the

cosh ceil

Last updated: Sat, 27 Jan 2007

view this page in

# cos

(PHP 3, PHP 4, PHP 5)

cos -- Cosine

## Description

float cos ( float arg )

cos() returns the cosine of the `arg` parameter. The `arg` parameter is in radians.

Пример 1. cos() example

`<?php echo cos(M_PI); // -1 ?>`

See also: acos(), sin(), tan(), and deg2rad().

add a note User Contributed Notes
cos
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));
?>`
add a note
cosh ceil

Last updated: Sat, 27 Jan 2007
show source | credits | stats | sitemap | contact | advertising | mirror sites
Copyright © 2001-2007 The PHP Group
All rights reserved.
This mirror generously provided by: Yahoo! Inc.
Last updated: Sat Mar 10 09:32:46 2007 PST