00001 /****************************************************************************************************** 00002 * (C) 2014 markummitchell@github.com. This file is part of Engauge Digitizer, which is released * 00003 * under GNU General Public License version 2 (GPLv2) or (at your option) any later version. See file * 00004 * LICENSE or go to gnu.org/licenses for details. Distribution requires prior written permission. * 00005 ******************************************************************************************************/ 00006 00007 #include "SplinePair.h" 00008 00009 SplinePair::SplinePair () : 00010 m_x (0.0), 00011 m_y (0.0) 00012 { 00013 } 00014 00015 SplinePair::SplinePair (double scalar) : 00016 m_x (scalar), 00017 m_y (scalar) 00018 { 00019 } 00020 00021 SplinePair::SplinePair(double x, 00022 double y) : 00023 m_x (x), 00024 m_y (y) 00025 { 00026 } 00027 00028 SplinePair::SplinePair(const SplinePair&other) : 00029 m_x (other.x()), 00030 m_y (other.y()) 00031 { 00032 } 00033 00034 SplinePair SplinePair::operator+(const SplinePair &other) const 00035 { 00036 SplinePair result (m_x + other.x(), 00037 m_y + other.y()); 00038 00039 return result; 00040 } 00041 00042 SplinePair SplinePair::operator-(const SplinePair &other) const 00043 { 00044 SplinePair result (m_x - other.x(), 00045 m_y - other.y()); 00046 00047 return result; 00048 } 00049 00050 SplinePair SplinePair::operator*(const SplinePair &other) const 00051 { 00052 SplinePair result (m_x * other.x(), 00053 m_y * other.y()); 00054 00055 return result; 00056 } 00057 00058 SplinePair SplinePair::operator/(const SplinePair &other) const 00059 { 00060 SplinePair result (m_x / other.x(), 00061 m_y / other.y()); 00062 00063 return result; 00064 } 00065 00066 double SplinePair::x() const 00067 { 00068 return m_x; 00069 } 00070 00071 double SplinePair::y() const 00072 { 00073 return m_y; 00074 }