Engauge Digitizer 2
Loading...
Searching...
No Matches
SplinePair.cpp
1/******************************************************************************************************
2 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released *
3 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file *
4 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. *
5 ******************************************************************************************************/
6
7#include "SplinePair.h"
8
10 m_x (0.0),
11 m_y (0.0)
12{
13}
14
15SplinePair::SplinePair (double scalar) :
16 m_x (scalar),
17 m_y (scalar)
18{
19}
20
22 double y) :
23 m_x (x),
24 m_y (y)
25{
26}
27
29 m_x (other.x()),
30 m_y (other.y())
31{
32}
33
35{
36 SplinePair result (m_x + other.x(),
37 m_y + other.y());
38
39 return result;
40}
41
43{
44 SplinePair result (m_x - other.x(),
45 m_y - other.y());
46
47 return result;
48}
49
51{
52 SplinePair result (m_x * other.x(),
53 m_y * other.y());
54
55 return result;
56}
57
59{
60 SplinePair result (m_x / other.x(),
61 m_y / other.y());
62
63 return result;
64}
65
66double SplinePair::x() const
67{
68 return m_x;
69}
70
71double SplinePair::y() const
72{
73 return m_y;
74}
Single X/Y pair for cubic spline interpolation initialization and calculations.
Definition SplinePair.h:12
double y() const
Get method for y.
double x() const
Get method for x.
SplinePair operator-(const SplinePair &other) const
Subtraction operator.
SplinePair()
Default constructor. Normally used only by generic container classes.
Definition SplinePair.cpp:9
SplinePair operator/(const SplinePair &other) const
Division operator.
SplinePair operator*(const SplinePair &other) const
Multiplication operator.
SplinePair operator+(const SplinePair &other) const
Addition operator.