summaryrefslogtreecommitdiff
path: root/common/accel-logarithmic.hpp
blob: b628327a5b7c30dc687da99be46b9cf5d7a029cb (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#pragma once

#include <math.h>

#include "accel-base.hpp"

namespace rawaccel {

	/// <summary> Struct to hold logarithmic acceleration implementation. </summary>
	struct accel_logarithmic : accel_base {

		accel_logarithmic(accel_args args) : accel_base(args) {}

		inline double accelerate(double speed) const {
			//f(x) = log(m*x+1)
			return log(speed_coeff * speed + 1);
		}
	};

}