Libftpp
A modern C++ library
perlin_noise_2D.hpp
Go to the documentation of this file.
1 #ifndef PERLIN_NOISE_HPP
2 #define PERLIN_NOISE_HPP
3 
4 #include <cmath>
5 
6 #include "../IVector2/ivector2.hpp"
7 #include "../random_2D_coordinate_generator/random_2D_coordinate_generator.hpp"
21 {
22 private:
24  float linearInterpolation(float a, float b, float t);
25  IVector2<float> gradient(const int& i, const int& j);
26  float fade(const float& t);
27 
28 public:
29  float sample(const float& x, const float& y);
30 };
31 
32 #endif
2D Perlin Noise Generator
float sample(const float &x, const float &y)
2D Coordinate-Based Random Number Generator