~ubuntu-branches/ubuntu/oneiric/nux/oneiric

« back to all changes in this revision

Viewing changes to NuxCore/Math/Constants.h

  • Committer: Bazaar Package Importer
  • Author(s): Didier Roche
  • Date: 2010-11-18 19:17:32 UTC
  • Revision ID: james.westby@ubuntu.com-20101118191732-rn35790vekj6o4my
Tags: upstream-0.9.4
ImportĀ upstreamĀ versionĀ 0.9.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * Copyright 2010 Inalogic Inc.
 
3
 *
 
4
 * This program is free software: you can redistribute it and/or modify it
 
5
 * under the terms of the GNU Lesser General Public License version 3, as
 
6
 * published by the  Free Software Foundation.
 
7
 *
 
8
 * This program is distributed in the hope that it will be useful, but
 
9
 * WITHOUT ANY WARRANTY; without even the implied warranties of
 
10
 * MERCHANTABILITY, SATISFACTORY QUALITY or FITNESS FOR A PARTICULAR
 
11
 * PURPOSE.  See the applicable version of the GNU Lesser General Public
 
12
 * License for more details.
 
13
 *
 
14
 * You should have received a copy of both the GNU Lesser General Public
 
15
 * License version 3 along with this program.  If not, see
 
16
 * <http://www.gnu.org/licenses/>
 
17
 *
 
18
 * Authored by: Jay Taoko <jay.taoko_AT_gmail_DOT_com>
 
19
 *
 
20
 */
 
21
 
 
22
 
 
23
#ifndef CONSTANTS_H
 
24
#define CONSTANTS_H
 
25
 
 
26
#include <limits>
 
27
 
 
28
/*
 
29
PI with 500 decimals (from http://www.ex.ac.uk/cimt/general/pi10000.htm)
 
30
 
 
31
      3.1415926535   8979323846   2643383279   5028841971   6939937510
 
32
        5820974944   5923078164   0628620899   8628034825   3421170679
 
33
        8214808651   3282306647   0938446095   5058223172   5359408128
 
34
        4811174502   8410270193   8521105559   6446229489   5493038196
 
35
        4428810975   6659334461   2847564823   3786783165   2712019091
 
36
        4564856692   3460348610   4543266482   1339360726   0249141273
 
37
        7245870066   0631558817   4881520920   9628292540   9171536436
 
38
        7892590360   0113305305   4882046652   1384146951   9415116094
 
39
        3305727036   5759591953   0921861173   8193261179   3105118548
 
40
        0744623799   6274956735   1885752724   8912279381   8301194912
 
41
*/
 
42
// 2.7182818284590452353602874713526624977572470936999595749669676277
 
43
 
 
44
 
 
45
 
 
46
namespace nux
 
47
{
 
48
 
 
49
  class Const
 
50
  {
 
51
  public:
 
52
    static const float pi;
 
53
    static const float Pi;
 
54
    static const float e;
 
55
    static const float sqrt2;
 
56
    static const float sqrt3;
 
57
    static const float golden;
 
58
 
 
59
    static const double EpsilonMilli;
 
60
    static const double EpsilonMicro;
 
61
    static const double EpsilonNano;
 
62
    static const double EpsilonPico;
 
63
    static const double EpsilonFemto;
 
64
 
 
65
    static const float flt_epsilon;
 
66
    static const float dbl_epsilon;
 
67
 
 
68
  private:
 
69
    Const();
 
70
    ~Const();
 
71
    Const (const Const &);
 
72
    Const &operator = (const Const &);
 
73
  };
 
74
 
 
75
}
 
76
 
 
77
#endif // CONSTANTS_H
 
78