Your Ad Here

 Navigation
Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Books
Sample Chapters
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links




 Sponsors
 Links
wwwstores
golfing products
gambling sites
 Downloads
dzphp editor
EasyPHP
mysql_phpgenerator
php-studio-trial
phpdesigner_7_2_5
phpMyAdmin-3.4.3.2
/phptriad2-2-1
phpxedit_321
rapidphp 2011
WampServer2.1d-x64
WampServer2.1e-x32
xampp-win32-1.7.4-VC6-installer
xampplite-win32-1.7.3
 Misc
Webmaster Resources
Only PHP
ScriptSearch.com
Scripts.com - Get the best scripts NOW!
AndreaPHP Programming

Valid XHTML 1.0 Transitional


Valid CSS!


Converting from degrees to radians and vice versa


Converting from degrees to radians and vice versa

Unlike many other programming languages php actually has two bult in functions for dealing with radians to degrees and degrees to radians conversions these are rad2deg and deg2rad .

In this simple little example we will show you how to use this time saving pair of functions .

Code :

<?php
$number = 0.986;
$degrees = 32;
//get the cosine of $number
$cos_number = cos($number);
//display the cosine of $number
echo "the cosine of " . $number ." is " . $cos_number;
echo "<br>";
//convert $cos_number to degrees
echo "convert to degrees " . rad2deg($cos_number);
echo "<br>";
//convert $degrees to radians
echo "convert $degrees to radians = " . deg2rad($degrees);
?>

Example :

 

the cosine of 0.986 is 0.552029566065
convert to degrees 31.628964302
convert 32 to radians = 0.558505360638



Books
 Sponsors


 Random Code
Wired news(xml)
read the contents of an ini file(beginner)
Display the date a page last modified(date and time)
 Random Article
  Network
Programming resources
Tutorials directory
Hosting resources
ASP site
Domain names
Progged
Maxi directory
bigarticle : free articles
A Code
Code N Tutorials
Get PHP
Programmers help




beginners PHP Copyright © 2004 onwards by beginnersPHP.