repositories
/
lsystem3d.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add the autogen.sh script to the source tree.
[lsystem3d.git]
/
src
/
vector.cpp
diff --git
a/src/vector.cpp
b/src/vector.cpp
index 7b518421adf90f30f8c1ddfeef2b50bfb7f533d8..06ce40c6c5d4e741f749ea8490975f0022f40d49 100644
(file)
--- a/
src/vector.cpp
+++ b/
src/vector.cpp
@@
-1,6
+1,6
@@
// Copyright (C) 2006 Erik Dahlberg
//
// Copyright (C) 2006 Erik Dahlberg
//
-// This file is part of LSystem3
d
.
+// This file is part of LSystem3
D
.
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
//
// LSystem3D is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
@@
-47,6
+47,23
@@
Vector::~Vector()
+/**
+ * Normalize vector
+ */
+void Vector::normalize()
+{
+ double length = sqrt(_x * _x + _y * _y + _z * _z);
+
+ if (length != 0)
+ {
+ _x /= length;
+ _y /= length;
+ _z /= length;
+ }
+}
+
+
+
/**
* Rotate around another vector
* @param angle rotation angle
/**
* Rotate around another vector
* @param angle rotation angle
@@
-83,24
+100,7
@@
void Vector::rotate(double angle, Vector vector)
/**
/**
- * Normalize vector
- */
-void Vector::normalize()
-{
- double length = sqrt(_x * _x + _y * _y + _z * _z);
-
- if (length != 0)
- {
- _x /= length;
- _y /= length;
- _z /= length;
- }
-}
-
-
-
-/**
- * Get scalar product of the vectors
+ * Get scalar product of two vectors
* @param vector arbitrary vector
* @return the scalar product
*/
* @param vector arbitrary vector
* @return the scalar product
*/
@@
-116,7
+116,7
@@
double Vector::getScalarProduct(Vector vector)
/**
/**
- * Get cross product of t
he
vectors
+ * Get cross product of t
wo
vectors
* @param vector arbitrary vector
* @return the cross product
*/
* @param vector arbitrary vector
* @return the cross product
*/
@@
-132,7
+132,7
@@
Vector Vector::getCrossProduct(Vector vector)
/**
/**
- * Get angle between t
he
vectors
+ * Get angle between t
wo
vectors
* @param vector the second (normalized) vector
* @return the angle, in degrees
*/
* @param vector the second (normalized) vector
* @return the angle, in degrees
*/