fix(norm): remove usage of friend
This commit is contained in:
parent
b4f48cdfb0
commit
dc57ca2395
5 changed files with 15 additions and 9 deletions
|
|
@ -13,12 +13,15 @@ Point &Point::operator=(const Point &other) {
|
|||
};
|
||||
Point::~Point() {}
|
||||
|
||||
Fixed Point::getX() const { return x; }
|
||||
Fixed Point::getY() const { return y; }
|
||||
|
||||
Fixed Point::triangleArea(Point const &a, Point const &b, Point const &c) {
|
||||
return (((a.x * (b.y - c.y)) + (b.x * (c.y - a.y)) + (c.x * (a.y - b.y))) / 2)
|
||||
.abs();
|
||||
}
|
||||
|
||||
std::ostream &operator<<(std::ostream &stream, const Point &p) {
|
||||
stream << "(" << p.x << ", " << p.y << ")";
|
||||
stream << "(" << p.getX() << ", " << p.getY() << ")";
|
||||
return stream;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue