#include "boundary.h" boundary::boundary() { note=40; //middle C } boundary::boundary(int _note) { note=_note; } boundary::~boundary() { } void boundary::draw(){ if (points.size()>1) { for (int i=0;i0) { points.erase(points.end()-1); getCentroid(); } } void boundary::getCentroid(){ float x=0; float y=0; for (int i=0;i min(p1.y,p2.y)) { if (p.y <= max(p1.y,p2.y)) { if (p.x <= max(p1.x,p2.x)) { if (p1.y != p2.y) { xinters = (p.y-p1.y)*(p2.x-p1.x)/(p2.y-p1.y)+p1.x; if (p1.x == p2.x || p.x <= xinters) counter++; } } } } p1 = p2; } if (counter % 2 == 0) return false; else return true; }