|
OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
|
2D unit-direction value type. Mirrors occtl_direction2_t.
More...
#include <geom.hpp>
Public Member Functions | |
| Direction2 (const occtl_direction2_t &theC) noexcept | |
| Wraps an existing C value type (zero-cost). Caller guarantees unit norm. | |
| const occtl_direction2_t & | c_type () const noexcept |
| Borrows-it view of the underlying C value type. | |
| double | x () const noexcept |
| X component (unit-normalised). | |
| double | y () const noexcept |
| Y component (unit-normalised). | |
| double | angle (const Direction2 &theOther) const noexcept |
Angle in radians between this and theOther, in [0, π]. Never throws. | |
Static Public Member Functions | |
| static Direction2 | from_vector (const Vector2 &theV) |
| Builds a normalised direction from a vector. | |
2D unit-direction value type. Mirrors occtl_direction2_t.
There is no default constructor: a default direction is not meaningful. Use from_vector to build one from a non-zero Vector2.
|
inlinestatic |
Builds a normalised direction from a vector.
| Error | with code OCCTL_GEOMETRY_INVALID when theV has zero length. |