|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
2D free-vector value type. Mirrors occtl_vector2_t.
More...
#include <geom.hpp>
Public Member Functions | |
| Vector2 () noexcept | |
| Default-constructs the zero vector. | |
| Vector2 (const double theX, const double theY) noexcept | |
| Constructs from explicit components. | |
| Vector2 (const occtl_vector2_t &theC) noexcept | |
| Wraps an existing C value type (zero-cost). | |
| const occtl_vector2_t & | c_type () const noexcept |
| Borrows-it view of the underlying C value type. | |
| double | x () const noexcept |
| X component. | |
| double | y () const noexcept |
| Y component. | |
| double | dot (const Vector2 &theOther) const noexcept |
| Dot product with another vector. Never throws. | |
| double | cross (const Vector2 &theOther) const noexcept |
| Signed scalar cross product (Z-component). Never throws. | |
| double | magnitude () const noexcept |
| Euclidean length. Never throws. | |
| Vector2 | normalized () const |
| Returns this vector normalised to unit length. | |
2D free-vector value type. Mirrors occtl_vector2_t.
|
inline |
Returns this vector normalised to unit length.
| Error | with code OCCTL_GEOMETRY_INVALID when this vector has zero length. |