Browse Source

Math: improve docs for vector cross/dot product.

Comes handy. In my case to prevent more embarassing mistakes in the
future.
pull/94/head
Vladimír Vondruš 11 years ago
parent
commit
7be1239adf
  1. 6
      src/Magnum/Math/Vector.h
  2. 4
      src/Magnum/Math/Vector2.h
  3. 4
      src/Magnum/Math/Vector3.h

6
src/Magnum/Math/Vector.h

@ -92,9 +92,9 @@ template<std::size_t size, class T> class Vector {
/**
* @brief Dot product
*
* Returns `0` if two vectors are orthogonal, `1` if two *normalized*
* vectors are parallel and `-1` if two *normalized* vectors are
* antiparallel. @f[
* Returns `0` when two vectors are perpendicular, `1` when two
* *normalized* vectors are parallel and `-1` when two *normalized*
* vectors are antiparallel. @f[
* \boldsymbol a \cdot \boldsymbol b = \sum_{i=0}^{n-1} \boldsymbol a_i \boldsymbol b_i
* @f]
* @see @ref dot() const, @ref operator-(), @ref Vector2::perpendicular()

4
src/Magnum/Math/Vector2.h

@ -88,7 +88,9 @@ template<class T> class Vector2: public Vector<2, T> {
* 2D version of cross product, also called perp-dot product,
* equivalent to calling @ref Vector3::cross() with Z coordinate set to
* `0` and extracting only Z coordinate from the result (X and Y
* coordinates are always zero). @f[
* coordinates are always zero). Returns `0` either when one of the
* vectors is zero or they are parallel or antiparallel and `1` when
* two *normalized* vectors are perpendicular, @f[
* \boldsymbol a \times \boldsymbol b = \boldsymbol a_\bot \cdot \boldsymbol b = a_xb_y - a_yb_x
* @f]
* @see @ref perpendicular(),

4
src/Magnum/Math/Vector3.h

@ -104,7 +104,9 @@ template<class T> class Vector3: public Vector<3, T> {
/**
* @brief Cross product
*
* Done using the following equation: @f[
* Result has length of `0` either when one of them is zero or they are
* parallel or antiparallel and length of `1` when two *normalized*
* vectors are perpendicular. Done using the following equation: @f[
* \boldsymbol a \times \boldsymbol b = \begin{pmatrix} c_y \\ c_z \\ c_x \end{pmatrix} ~~~~~
* \boldsymbol c = \boldsymbol a \begin{pmatrix} b_y \\ b_z \\ b_x \end{pmatrix} -
* \boldsymbol b \begin{pmatrix} a_y \\ a_z \\ a_x \end{pmatrix}

Loading…
Cancel
Save