/* * pyramid.cpp * * Created on: 14.03.2013 * Author: trifon */ #include "pyramid.h" Pyramid::Pyramid() { a = b = c = 0; } Pyramid::Pyramid(double _a, double _b, double _c) { // TODO: провери, че a, b, c са положителни a = _a; b = _b; c = _c; } bool Pyramid::isInside(Point3D p) const { if (p.getZ() < 0) return false; Point2D p2 = p.getP(); if (p2.getX() < 0) return false; if (p.getP().getY() < 0) return false; if (p2.getX()/a + p2.getY()/b + p.getZ()/c <= 1) return true; return false; }