| Flutter Impeller |

constants.h
Go to the documentation of this file.
1 // Copyright 2013 The Flutter Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_
6 #define FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_
7
8 namespace impeller {
9
10 // e
11 constexpr float kE = 2.7182818284590452354f;
12
13 // log_2 e
14 constexpr float kLog2E = 1.4426950408889634074f;
15
16 // log_10 e
17 constexpr float kLog10E = 0.43429448190325182765f;
18
19 // log_e 2
20 constexpr float kLogE2 = 0.69314718055994530942f;
21
22 // log_e 10
23 constexpr float kLogE10 = 2.30258509299404568402f;
24
25 // pi
26 constexpr float kPi = 3.14159265358979323846f;
27
28 // pi*2
29 constexpr float k2Pi = 6.28318530717958647693f;
30
31 // pi/2
32 constexpr float kPiOver2 = 1.57079632679489661923f;
33
34 // pi/4
35 constexpr float kPiOver4 = 0.78539816339744830962f;
36
37 // 1/pi
38 constexpr float k1OverPi = 0.31830988618379067154f;
39
40 // 2/pi
41 constexpr float k2OverPi = 0.63661977236758134308f;
42
43 // 2/sqrt(pi)
44 constexpr float k2OverSqrtPi = 1.12837916709551257390f;
45
46 // sqrt(2)
47 constexpr float kSqrt2 = 1.41421356237309504880f;
48
49 // sqrt(2) / 2 == 1/sqrt(2)
50 constexpr float k1OverSqrt2 = 0.70710678118654752440f;
51 constexpr float kSqrt2Over2 = 0.70710678118654752440f;
52
53 // phi
54 constexpr float kPhi = 1.61803398874989484820f;
55
56 // 0.001
57 constexpr float kEhCloseEnough = 1e-3f;
58
59 } // namespace impeller
60
61 #endif // FLUTTER_IMPELLER_GEOMETRY_CONSTANTS_H_
impeller
Definition: allocation.cc:12
impeller::k2Pi
constexpr float k2Pi
Definition: constants.h:29
impeller::k2OverSqrtPi
constexpr float k2OverSqrtPi
Definition: constants.h:44
impeller::kPi
constexpr float kPi
Definition: constants.h:26
impeller::kSqrt2Over2
constexpr float kSqrt2Over2
Definition: constants.h:51
impeller::kEhCloseEnough
constexpr float kEhCloseEnough
Definition: constants.h:57
impeller::kE
constexpr float kE
Definition: constants.h:11
impeller::kPiOver2
constexpr float kPiOver2
Definition: constants.h:32
impeller::kLog10E
constexpr float kLog10E
Definition: constants.h:17
impeller::kLogE10
constexpr float kLogE10
Definition: constants.h:23
impeller::kLog2E
constexpr float kLog2E
Definition: constants.h:14
impeller::kPiOver4
constexpr float kPiOver4
Definition: constants.h:35
impeller::kSqrt2
constexpr float kSqrt2
Definition: constants.h:47
impeller::kLogE2
constexpr float kLogE2
Definition: constants.h:20
impeller::k1OverPi
constexpr float k1OverPi
Definition: constants.h:38
impeller::k2OverPi
constexpr float k2OverPi
Definition: constants.h:41
impeller::kPhi
constexpr float kPhi
Definition: constants.h:54
impeller::k1OverSqrt2
constexpr float k1OverSqrt2
Definition: constants.h:50