diff options
author | Jakob Odersky <jodersky@gmail.com> | 2011-03-02 14:53:18 +0000 |
---|---|---|
committer | Jakob Odersky <jodersky@gmail.com> | 2011-03-02 14:53:18 +0000 |
commit | 6cefc36791afe98cbaaa95056ac5f2d64e240901 (patch) | |
tree | 207b685717a913a2b1242c07b572501b3d9bf374 | |
parent | 44f26b2b6ea3b43e2a56c5f5b2e00069e17f7d62 (diff) | |
download | vhc-6cefc36791afe98cbaaa95056ac5f2d64e240901.tar.gz vhc-6cefc36791afe98cbaaa95056ac5f2d64e240901.tar.bz2 vhc-6cefc36791afe98cbaaa95056ac5f2d64e240901.zip |
Made Vector3 static variables Null, i, j, k constant.
-rw-r--r-- | reponses.lyx | 6 | ||||
-rw-r--r-- | src/vhc/Vector3.cc | 8 | ||||
-rw-r--r-- | src/vhc/Vector3.h | 8 |
3 files changed, 14 insertions, 8 deletions
diff --git a/reponses.lyx b/reponses.lyx index cee300e..9d78304 100644 --- a/reponses.lyx +++ b/reponses.lyx @@ -87,5 +87,11 @@ Un vecteur est complètement invariable. réel. \end_layout +\begin_layout Standard +Quelques vecteurs remarquables sont définis comme variables statiques constantes. + Parmi ceux-ci notamment le vecteur nulle (Null) et les vecteurs unitaires + i, j, k selon respectivement les axes x, y et z. +\end_layout + \end_body \end_document diff --git a/src/vhc/Vector3.cc b/src/vhc/Vector3.cc index 9628036..deb56b9 100644 --- a/src/vhc/Vector3.cc +++ b/src/vhc/Vector3.cc @@ -12,10 +12,10 @@ using namespace std; namespace vhc { -Vector3 Vector3::Null = Vector3(0.0, 0.0, 0.0); -Vector3 Vector3::i = Vector3(1.0, 0.0, 0.0); -Vector3 Vector3::j = Vector3(0.0, 1.0, 0.0); -Vector3 Vector3::k = Vector3(0.0, 0.0, 1.0); +Vector3 const Vector3::Null = Vector3(0.0, 0.0, 0.0); +Vector3 const Vector3::i = Vector3(1.0, 0.0, 0.0); +Vector3 const Vector3::j = Vector3(0.0, 1.0, 0.0); +Vector3 const Vector3::k = Vector3(0.0, 0.0, 1.0); ostream& operator<< (ostream& output, const Vector3& v) { output << v.toString(); diff --git a/src/vhc/Vector3.h b/src/vhc/Vector3.h index 5789968..9969352 100644 --- a/src/vhc/Vector3.h +++ b/src/vhc/Vector3.h @@ -89,16 +89,16 @@ public: }; /** Null vector. (0,0,0) */ - static Vector3 Null; + static const Vector3 Null; /** X-axis unit vector. (1, 0, 0) */ - static Vector3 i; + static const Vector3 i; /** Y-axis unit vector. (0, 1, 0) */ - static Vector3 j; + static const Vector3 j; /** Z-axis unit vector. (0, 0, 1) */ - static Vector3 k; + static const Vector3 k; }; |