OCCT-Light 0.1
C ABI and C++ veneer for multi-language CAD workflows
Loading...
Searching...
No Matches
occtl::Vector3 Struct Reference

3D free-vector value type. Mirrors occtl_vector3_t. More...

#include <geom.hpp>

Public Member Functions

 Vector3 () noexcept
 Default-constructs the zero vector.
 
 Vector3 (const double theX, const double theY, const double theZ) noexcept
 Constructs from explicit components.
 
 Vector3 (const occtl_vector3_t &theC) noexcept
 Wraps an existing C value type (zero-cost).
 
const occtl_vector3_tc_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 z () const noexcept
 Z component.
 
double dot (const Vector3 &theOther) const noexcept
 Dot product with another vector. Never throws.
 
Vector3 cross (const Vector3 &theOther) const noexcept
 Cross product with another vector. Never throws.
 
double magnitude () const noexcept
 Euclidean length. Never throws.
 
Vector3 normalized () const
 Returns this vector normalised to unit length.
 
Vector3 operator+ (const Vector3 &theOther) const noexcept
 Component-wise sum.
 
Vector3 operator- (const Vector3 &theOther) const noexcept
 Component-wise difference.
 
Vector3 operator* (const double theS) const noexcept
 Scalar multiplication.
 
Vector3 reversed () const noexcept
 Returns this vector negated.
 
double angle (const Vector3 &theOther) const
 Angle in radians between this and theOther, in [0, π].
 

Detailed Description

3D free-vector value type. Mirrors occtl_vector3_t.

Member Function Documentation

◆ angle()

double occtl::Vector3::angle ( const Vector3 theOther) const
inline

Angle in radians between this and theOther, in [0, π].

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when either vector has zero length.

◆ normalized()

Vector3 occtl::Vector3::normalized ( ) const
inline

Returns this vector normalised to unit length.

Exceptions
Errorwith code OCCTL_GEOMETRY_INVALID when this vector has zero length.

The documentation for this struct was generated from the following file: