Question: My lab professor wants us to use a while statement to have a parabola curving downward (gravity equation), but not going negative without an if statement in c++11. The code below works fine except for the fact that one negative value is still used. Is there a way to remove this last x/y value?

```
#include <iostream>
#include <cmath> 
using namespace std;  
int main() {
    const double gravAccel = 9.82;
    double initHeight;
    double itemAngle;
    double itemSpeed;
    double horzCoord = 0;
    double vertCoord;
    cout <<"What is the initial height of the projectile?";
    cin >> initHeight;
    cout <<"What angle is the projectile launched at?";
    cin >> itemAngle;
    cout <<"What is the projectile's speed?";
    cin >> itemSpeed;
    while (vertCoord >= 0)
    {
        vertCoord = initHeight + horzCoord*tan(itemAngle) - ((gravAccel*pow(horzCoord,2))/(2*(pow(itemSpeed*cos(itemAngle),2))));
        cout << horzCoord << "meters, " << vertCoord << "meters" << endl;
        horzCoord++;
    }

return 0; }

```

Answer: 
You can get the file name of where a class is declared using a [`ReflectionClass` instance and its `getFileName()` method](http://www.php.net/manual/en/reflectionclass.getfilename.php):

```
$reflector = new ReflectionClass(\Vendor\Package\Class::class);
echo $reflector->getFileName();

```
You could use the `__NAMESPACE__` global and then replace the backslash with the proper directory separator, then use the `__FILE__` global to append the filename

```
$ns = str_replace( __NAMESPACE__, DIRECTORY_SEPARATOR, '\\' );
$path = $ns.DIRECTORY_SEPARATOR.__FILE__;

```

and then do what you want with it.