Added == operator to vec2d
This commit is contained in:
parent
699490fefc
commit
02f60aaa8a
7
vec2d.h
7
vec2d.h
@ -1,7 +1,10 @@
|
|||||||
#ifndef VEC2D_H_INCLUDED
|
#ifndef VEC2D_H_INCLUDED
|
||||||
#define VEC2D_H_INCLUDED
|
#define VEC2D_H_INCLUDED
|
||||||
|
|
||||||
|
#include "cairo.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <iostream>
|
||||||
#include <ostream>
|
#include <ostream>
|
||||||
|
|
||||||
class vec2d {
|
class vec2d {
|
||||||
@ -53,6 +56,10 @@ class vec2d {
|
|||||||
return vec2d{x / a, y / a};
|
return vec2d{x / a, y / a};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool operator==(vec2d& o) const {
|
||||||
|
return x == o.x && y == o.y;
|
||||||
|
}
|
||||||
|
|
||||||
vec2d& rotate(double angle) {
|
vec2d& rotate(double angle) {
|
||||||
double sin_a = sin(angle);
|
double sin_a = sin(angle);
|
||||||
double cos_a = cos(angle);
|
double cos_a = cos(angle);
|
||||||
|
Loading…
Reference in New Issue
Block a user