056e22d5e3f4c17fa00bc0879f24c35fb7f55f9f
1 // Copyright (C) 2006 Erik Dahlberg
3 // This file is part of LSystem3D.
5 // LSystem3D is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // LSystem3D is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with LSystem3D; if not, write to the Free Software
17 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "coordinate.h"
32 class Vector
: public Coordinate
37 * @param x the x-coordinate
38 * @param y the y-coordinate
39 * @param z the z-coordinate
41 Vector(double x
= 0.0, double y
= 1.0, double z
= 0.0);
49 * Rotate around another vector
50 * @param angle rotation angle
51 * @param vector arbitrary vector to rotate around
53 void rotate(double angle
, Vector vector
);
61 * Get scalar product of two vectors
62 * @param vector arbitrary vector
63 * @return the scalar product
65 double getScalarProduct(Vector vector
);
68 * Get cross product of two vectors
69 * @param vector arbitrary vector
70 * @return the cross product
72 Vector
getCrossProduct(Vector vector
);
75 * Get angle between two vectors
76 * @param vector the second (normalized) vector
77 * @return the angle, in degrees
79 double getAngle(Vector vector
);