Your Ad Here

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




 Sponsors
 Links
finance products
golfing products
domain names
 Downloads
 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
Directory file viewer improved version(file system)
encrypt a password(string)
watermark an image example(image)
 Random Article
  Network
Programming resources
Tutorials directory
Clickbank mall
sell software
Free auctions, low cost stores
UK products
US products
Gambling directory
Sexy free wallpapers
Hosting resources
ASP site
DVD site
Domain names
Dating site
Software directory
Maxi directory
bigarticle : free articles




beginners PHP Copyright © 2004 onwards by beginnersPHP.