LibreCAD
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
geocoordinate.cpp
Go to the documentation of this file.
1 #include "geocoordinate.h"
2 #include "cad/math/lcmath.h"
3 
4 using namespace lc;
5 using namespace geo;
6 
7 double Coordinate::angleBetween(const Coordinate& v1, const Coordinate& v2) const {
8  Coordinate vStart(v1 - (*this));
9  Coordinate vEnd(v2 - (*this));
10  return atan2(vStart.x() * vEnd.y() - vStart.y() * vEnd.x(), vStart.x() * vEnd.x() + vStart.y() * vEnd.y());
11 }
double x() const
Returns x of Coordinate.
Definition: geocoordinate.h:26
double y() const
Returns y of Coordinate.
Definition: geocoordinate.h:34
Definition: cadentity.h:12
double angleBetween(const Coordinate &v1, const Coordinate &v2) const