static_sin.cpp 692 Bytes
Newer Older
Dmitry Bagaev's avatar
Dmitry Bagaev committed
1
2
3
4
5
6
7
//
// Created by Dmitri Bagaev on 2019-03-25.
//

#include "static_sin.h"

#include <cmath>
8
9
10
#ifndef M_PI
#define M_PI 3.1415926535897932384626433832795
#endif
Dmitry Bagaev's avatar
Dmitry Bagaev committed
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30

double StaticSin::invoke(double x, double y, int iteration) const noexcept {
    return 1.0 - std::sin(x);
}

std::pair<double, double> StaticSin::GetXRange() const noexcept {
    return std::make_pair(0, M_PI);
}

std::pair<double, double> StaticSin::GetYRange() const noexcept {
    return std::make_pair(0, M_PI);
}

double StaticSin::GetMinimumValue(int iteration) const noexcept {
    return 0;
}

std::pair<double, double> StaticSin::GetMinimumPoint(int iteration) const noexcept {
    return std::make_pair(M_PI / 2, 0.0);
}