|
cos
Cosine
(PHP 4, PHP 5)
Related Examples ( Source code ) » cos Examples ( Source code ) » Responding to Checkboxes Examples ( Source code ) » Define class level constant value to control the class behaviour Examples ( Source code ) » Strategy Pattern Demo Examples ( Source code ) » Use for loop to output HTML table Examples ( Source code ) » Nested function Examples ( Source code ) » Create a PDF document containing a pie chart Code Examples / Notes » cosjoescuriosityshoppe
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
Convert degree to radianus, radianus to cos. <?php // Degree $degree = 360; // Convertion print cos(deg2rad($degree)); ?> |