1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
| bool Point::isBetween(Point A, Point B)
{
if (A.getX() < B.getX())
{
if (this->getX() < A.getX() || this->getX() > B.getX()) return false;
}
else if (A.getX() > B.getX())
{
if (this->getX() > A.getX() || this->getX() < B.getX()) return false;
}
if (A.getY() < B.getY())
{
if (this->getY() < A.getY() || this->getY() > B.getY()) return false;
}
else if (A.getY() > B.getY())
{
if (this->getY() > A.getY() || this->getY() < B.getY()) return false;
}
if (A.getZ() < B.getZ())
{
if (this->getZ() < A.getZ() || this->getZ() > B.getZ()) return false;
}
else if (A.getZ() > B.getZ())
{
if (this->getZ() > A.getZ() || this->getZ() < B.getZ()) return false;
}
return true;
} |
Partager