projects
/
synfig.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow the 'subtract' convert type to work with times.
[synfig.git]
/
synfig-core
/
trunk
/
src
/
synfig
/
vector.h
diff --git
a/synfig-core/trunk/src/synfig/vector.h
b/synfig-core/trunk/src/synfig/vector.h
index
c509c3c
..
13a3805
100644
(file)
--- a/
synfig-core/trunk/src/synfig/vector.h
+++ b/
synfig-core/trunk/src/synfig/vector.h
@@
-27,6
+27,7
@@
/* === H E A D E R S ======================================================= */
/* === H E A D E R S ======================================================= */
+#include "angle.h"
#include "real.h"
#include <math.h>
#include "real.h"
#include <math.h>
@@
-78,11
+79,11
@@
public:
value_type &
operator[](const int& i)
value_type &
operator[](const int& i)
- { return
(&_x)[i]
; }
+ { return
i?_y:_x
; }
const value_type &
operator[](const int& i) const
const value_type &
operator[](const int& i) const
- { return
(&_x)[i]
; }
+ { return
i?_y:_x
; }
const Vector &
operator+=(const Vector &rhs)
const Vector &
operator+=(const Vector &rhs)
@@
-169,6
+170,9
@@
public:
Vector perp()const
{ return Vector(_y,-_x); }
Vector perp()const
{ return Vector(_y,-_x); }
+ Angle angle()const
+ { return Angle::rad(atan2(_y, _x)); }
+
bool is_equal_to(const Vector& rhs)const
{
static const value_type epsilon(0.0000000000001);
bool is_equal_to(const Vector& rhs)const
{
static const value_type epsilon(0.0000000000001);