MySQL
  Home arrow MySQL arrow Page 2 - Optimizing Queries with Operators, Bra...
Dev Shed Forums 
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
Dedicated Servers 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Moblin 
JMSL Numerical Library 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
MYSQL

Optimizing Queries with Operators, Branching and Functions, continued
By: Apress Publishing
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 4 stars4 stars4 stars4 stars4 stars / 6
    2006-04-06

    Table of Contents:
  • Optimizing Queries with Operators, Branching and Functions, continued
  • Trigonometric Functions
  • Other Math Functions
  • Conversion of Numbers Between Bases
  • String Functions and Regular Expressions
  • Pattern-Matching and Regular Expressions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Optimizing Queries with Operators, Branching and Functions, continued - Trigonometric Functions


    (Page 2 of 6 )

    The trigonometric functions are useful for calculating lengths, arcs, and angles, as well as plotting curves and performing complex calculations involving waves.


    NOTE
     We won’t attempt to provide definitions or to explain trigonometry here. If you don’t already know what they are or how to use them, check out the MathWorld web site, starting from
    http://mathworld.wolfram.com/Trigonometry. html.

    MySQL provides the following trigonometric functions, where X is an angle expressed in radians:

    SIN(X): Sine of X

    COS(X): Cosine of X

    TAN(X): Tangent of X

    COT(X): Cotangent of X


    NOTE 
    The secant and cosecant trigonometric functions (often written as sec and csc in mathematical notation) can be obtained in MySQL by using the expressions 1 / COS(X) and 1 / SIN(X) , respectively.

    The radian is a unit of angular measure defined such that 180 degrees is equal to p (pi) radians. (The number p is represented in MySQL as PI().) To convert radians to degrees, you can use the DEGREES() function, and to convert from degrees to radians, use the RADIANS() function.

    The inverse trigonometric functions all return angle values expressed in radians:

    ASIN(X): Arcsine of X

    ACOS(X): Arccosine of X

    ATAN(X): Arctangent of X

    ATAN(X,  Y) or ATAN2(X,  Y): Arctangent of Y / X


    NOTE
       MySQL stores p and e as double-precision floating-point values. This should be of sufficient accuracy for 99% of all applications requiring the use of these values.

     

    More MySQL Articles
    More By Apress Publishing


       · This article is an excerpt from the book "Beginning MySQL Database Design and...
     

    Buy this book now. This article is excerpted from chapter four of Beginning MySQL Database Design and Optimization: From Novice to Professional, written by Jon Stephens and Chad Russell (Apress; ISBN: 1590593324). Check it out at your favorite bookstore today. Buy this book now.

       

    MYSQL ARTICLES

    - Take Some Load off MySQL with MemCached
    - MySQL Table Prefix Changer Tool in PHP
    - Using the SIGNAL Statement for Error Handling
    - Error Handling Examples
    - Error Handling
    - Completing a Search Engine with MySQL and PH...
    - Paginating Result Sets for a Search Engine B...
    - Building a Search Engine with MySQL and PHP 5
    - Using Boolean Operators for Full Text and Bo...
    - PHP, MySQL and the PEAR Database
    - Working with PHP and MySQL
    - Getting PHP to Talk to MySQL
    - Creating an RSS Reader: the Reader
    - MySQL Security Overview
    - Creating the Admin Script for a PHP/MySQL Bl...





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway