Files
GTSchoolShit/CS4451/proj1/ray.cpp
2025-06-07 01:59:34 -04:00

39 lines
557 B
C++

#include <math.h>
#include <ostream>
#include <stdlib.h>
#include <vector>
#include "defs.h"
#include "functions.h"
Ray::Ray (Point start, Point end) {
this->direction = (end-start);
this->origin = end;
}
Ray Ray::operator+(Ray &other) {
Ray r;
r.direction = direction + other.direction;
r.origin = origin + other.origin;
return r;
}
Ray Ray::operator-(Ray &other) {
Ray r;
r.direction = direction - other.direction;
r.origin = origin - other.origin;
return r;
}