Phoenix2D-Library  0.10
Vector2D.h
Go to the documentation of this file.
1 /*
2  * Phoenix2D (RoboCup Soccer Simulation 2D League)
3  * Copyright (c) 2013 Ivan Gonzalez
4  *
5  * This file is part of Phoenix2D.
6  *
7  * Phoenix2D is free software: you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License as published by
9  * the Free Software Foundation, either version 3 of the License, or
10  * (at your option) any later version.
11  *
12  * Phoenix2D is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with Phoenix2D. If not, see <http://www.gnu.org/licenses/>.
19  */
20 
21 #ifndef VECTOR2D_H_
22 #define VECTOR2D_H_
23 
24 #include <string>
25 
29 namespace Phoenix
30 {
31 
38  V2D
39 };
40 
45 class Vector2D {
46  double dx;
47  double dy;
48  double magnitude;
49  double direction;
51  //Vector2D(double magnitude, double direction);
52 public:
53  Vector2D();
54  Vector2D(double x, double y);
55  static Vector2D getEmptyVector();
56  static Vector2D getVector2DWithXAndY(double dx, double dy);
58  ~Vector2D();
59  double getXComponent();
60  double getYComponent();
61  double getMagnitude();
62  double getDirection();
64  Vector2D operator *(double scalar);
65  std::string toString();
67 };
68 } // End namespace Phoenix
71 #endif /* VECTOR2D_H_ */
double magnitude
Definition: Vector2D.h:48
Vector 2D.
Definition: Vector2D.h:38
Vector2D operator+(Vector2D vector)
Definition: Vector2D.cpp:79
double getDirection()
Definition: Vector2D.cpp:75
static Vector2D getVector2DWithXAndY(double dx, double dy)
Definition: Vector2D.cpp:59
double getYComponent()
Definition: Vector2D.cpp:67
static double x
Definition: Self.cpp:89
std::string toString()
Definition: Vector2D.cpp:91
static Vector2D getVector2DWithMagnitudeAndDirection(double magnitude, double direction)
Definition: Vector2D.cpp:53
Vector2D operator*(double scalar)
Definition: Vector2D.cpp:85
static Vector2D getEmptyVector()
Definition: Vector2D.cpp:49
Empty Type.
Definition: Vector2D.h:37
VECTOR_TYPE type
Definition: Vector2D.h:50
VECTOR_TYPE
VECTOR_TYPE The Vector Type lorem Ipsum
Definition: Vector2D.h:36
static double y
Definition: Self.cpp:90
VECTOR_TYPE getType()
Definition: Vector2D.cpp:103
double direction
Definition: Vector2D.h:49
double getXComponent()
Definition: Vector2D.cpp:63
double getMagnitude()
Definition: Vector2D.cpp:71
Vector2D The Vector2D lorem Ipsum
Definition: Vector2D.h:45