100 for (
size_t i = 0; i <
npoints(); ++i) {
118 for (
size_t i = 0; i < poly.
npoints(); ++i) {
151 double lhs(0.0),
rhs(0.0);
152 for (
size_t i = 0; i <
npoints(); ++i) {
156 lhs += v_ip1.
X() * v_i.
Y();
157 rhs += v_i.
X() * v_ip1.
Y();
201 double x{vertex.X()},
y{vertex.Y()};
217 return 0.5 * (b.
X() - a.
X()) * (c.
Y() - a.
Y()) - (c.
X() - a.
X()) * (b.
Y() - a.
Y());
231 os <<
"ConvexPolygon(";
232 const size_t npoints(polygon.
npoints());
233 for (
size_t i = 0; i < npoints; ++i) {
const std::vector< double > & rhs
std::map< DeltaEMode::Type, std::string > index
An implementation of a convex polygon.
double m_minX
Lowest X value.
virtual size_t npoints() const
Return the number of vertices.
virtual const Kernel::V2D & operator[](const size_t index) const
Index access.
double m_maxY
Highest Y value.
ConvexPolygon()
Default constructor.
void insert(const Kernel::V2D &pt)
Insert a new vertex.
double m_minY
Lowest Y value.
virtual double area() const
Compute the area of the polygon using triangulation.
void clear()
Clears all points.
void setup()
Setup the meta-data.
bool isValid() const
Check if polygon is valid.
double m_maxX
Highest X value.
virtual bool contains(const Kernel::V2D &point) const
Is a point inside this polygon.
virtual double minY() const
Return the lowest Y value in the polygon.
virtual double determinant() const
Compute the 'determinant' of the points.
virtual double maxY() const
Return the largest Y value in the polygon.
std::vector< Kernel::V2D > Vertices
Type of the point list.
virtual double maxX() const
Return the largest X value in the polygon.
virtual double minX() const
Return the lowest X value in the polygon.
double triangleArea(const Kernel::V2D &a, const Kernel::V2D &b, const Kernel::V2D &c) const
Compute the area of a triangle given by 3 points.
virtual ConvexPolygon toPoly() const
Return a new Polygon based on the current type.
virtual const Kernel::V2D & at(const size_t index) const
Bounds-checked index access.
PolygonEdge Defines a directed edge between two points on a polygon.
Exception for index errors.
Implements a 2-dimensional vector embedded in a 3D space, i.e.
double Y() const
Y position.
double X() const
X position.
MANTID_GEOMETRY_DLL PointClassification classify(const Kernel::V2D &pt, const PolygonEdge &edge)
Helper function for classification.
MANTID_GEOMETRY_DLL std::ostream & operator<<(std::ostream &stream, const PointGroup &self)
Returns a streamed representation of the PointGroup object.
@ OnLeft
Point is to left of edge.