Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F78976578
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
Sat, Aug 24, 02:17
Size
568 B
Mime Type
text/x-c
Expires
Mon, Aug 26, 02:17 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
20130544
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