Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120664502
Point2d.cpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sun, Jul 6, 03:01
Size
568 B
Mime Type
text/x-c
Expires
Tue, Jul 8, 03:01 (2 d)
Engine
blob
Format
Raw Data
Handle
27225000
Attached To
R9360 PCSC_git
Point2d.cpp
View Options
/*
* Point2d.hpp
*
* 2D Point class
*
* Created on: Nov 1, 2012
* Author: Radu Popescu <radu.popescu@epfl.ch>
*/
#include "Point2d.hpp"
double Point2d::sTolerance = 1e-9;
Point2d::Point2d(double a, double b) : x(a), y(b) {}
bool Point2d::operator<(const Point2d &other) const {
if ((x - other.x) < -sTolerance) {
return true;
} else if ((x - other.x) > sTolerance) {
return false;
} else if ((y - other.y) < -sTolerance) {
// x == other.x
return true;
} else {
// x == other.x and
// y >= other.y
return false;
}
}
Event Timeline
Log In to Comment