tcolorbar.h - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
HTML git clone git://src.adamsgaard.dk/sphere
DIR Log
DIR Files
DIR Refs
DIR LICENSE
---
tcolorbar.h (644B)
---
1 #ifndef COLORBAR_H_
2 #define COLORBAR_H_
3
4 // Functions that determine red-, green- and blue color components
5 // in a blue-white-red colormap. Ratio should be between 0.0-1.0.
6
7 __inline__ __host__ __device__ float red(float ratio)
8 {
9 return fmin(1.0f, 0.209f*ratio*ratio*ratio - 2.49f*ratio*ratio + 3.0f*ratio + 0.0109f);
10 };
11
12 __inline__ __host__ __device__ float green(float ratio)
13 {
14 return fmin(1.0f, -2.44f*ratio*ratio + 2.15f*ratio + 0.369f);
15 };
16
17 __inline__ __host__ __device__ float blue(float ratio)
18 {
19 return fmin(1.0f, -2.21f*ratio*ratio + 1.61f*ratio + 0.573f);
20 };
21
22 #endif
23 // vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4