#include <vgl_vector_3d.h>
(typically float or double). A vgl_vector_3d<T> represents the difference (or connecting vector) between two vgl_point_3d<T>s.
Use this class to do arithmetic (adding and scaling) in 3d geometric space.
Definition at line 30 of file vgl_vector_3d.h.
Public Member Functions | |
| T | x () const |
| T | y () const |
| T | z () const |
| vgl_vector_3d () | |
| Creates the vector (0,0,0) of zero length. | |
| vgl_vector_3d (T vx, T vy, T vz) | |
| Creates the vector (vx,vy,vz). | |
| vgl_vector_3d (const T v[3]) | |
| Creates the vector (vx,vy,vz). | |
| void | set (T vx, T vy, T vz) |
| Assignment. | |
| void | set (T const v[3]) |
| Set x, y and z. | |
| bool | operator== (vgl_vector_3d< T >const &v) const |
| Comparison. | |
| bool | operator!= (vgl_vector_3d< T >const &v) const |
| double | length () const |
| Return the length of this vector. | |
| T | sqr_length () const |
| Return the squared length of this vector. | |
| vgl_vector_3d< T > | orthogonal_vectors (double s) |
| One-parameter family of unit vectors that are orthogonal to *this, v(s). | |
Public Attributes | |
| T | x_ |
| T | y_ |
| T | z_ |
Related Functions | |
| (Note that these are not member functions.) | |
| vcl_istream & | read (vcl_istream &is) |
| Read from stream, possibly with formatting. | |
| vcl_istream & | operator>> (vcl_istream &is, vgl_vector_3d< T > &p) |
| Read from stream, possibly with formatting. | |
| vgl_vector_3d< T >::vgl_vector_3d | ( | ) | [inline] |
| vgl_vector_3d< T >::vgl_vector_3d | ( | T | vx, | |
| T | vy, | |||
| T | vz | |||
| ) | [inline] |
| vgl_vector_3d< T >::vgl_vector_3d | ( | const T | v[3] | ) | [inline] |
| T vgl_vector_3d< T >::x | ( | ) | const [inline] |
Definition at line 36 of file vgl_vector_3d.h.
| T vgl_vector_3d< T >::y | ( | ) | const [inline] |
Definition at line 37 of file vgl_vector_3d.h.
| T vgl_vector_3d< T >::z | ( | ) | const [inline] |
Definition at line 38 of file vgl_vector_3d.h.
| void vgl_vector_3d< T >::set | ( | T | vx, | |
| T | vy, | |||
| T | vz | |||
| ) | [inline] |
| void vgl_vector_3d< T >::set | ( | T const | v[3] | ) | [inline] |
| bool vgl_vector_3d< T >::operator== | ( | vgl_vector_3d< T >const & | v | ) | const [inline] |
| bool vgl_vector_3d< T >::operator!= | ( | vgl_vector_3d< T >const & | v | ) | const [inline] |
Definition at line 68 of file vgl_vector_3d.h.
| double vgl_vector_3d< T >::length | ( | ) | const |
| T vgl_vector_3d< T >::sqr_length | ( | ) | const [inline] |
| vgl_vector_3d< T > vgl_vector_3d< T >::orthogonal_vectors | ( | double | s | ) |
One-parameter family of unit vectors that are orthogonal to *this, v(s).
To get two orthogonal vectors call this function twice with s=0 and s=0.25 for example.
| s | 0<=s<=1, v(0)==v(1) |
This vector need not be normalized but it should have non-zero length.
Definition at line 23 of file vgl_vector_3d.txx.
| vcl_istream & vgl_vector_3d< T >::read | ( | vcl_istream & | is | ) | [related] |
Read from stream, possibly with formatting.
Either just reads three blank-separated numbers, or reads three comma-separated numbers, or reads three numbers in parenthesized form "(123, 321, 567)"
Definition at line 123 of file vgl_vector_3d.txx.
| vcl_istream & operator>> | ( | vcl_istream & | is, | |
| vgl_vector_3d< T > & | p | |||
| ) | [related] |
Read from stream, possibly with formatting.
Either just reads three blank-separated numbers, or reads three comma-separated numbers, or reads three numbers in parenthesized form "(123, 321, 567)"
Definition at line 153 of file vgl_vector_3d.txx.
| T vgl_vector_3d< T >::x_ |
Definition at line 33 of file vgl_vector_3d.h.
| T vgl_vector_3d< T >::y_ |
Definition at line 34 of file vgl_vector_3d.h.
| T vgl_vector_3d< T >::z_ |
Definition at line 35 of file vgl_vector_3d.h.
1.5.1