31#include <initializer_list>
62 constexpr Vec3() =
default;
154 return Vec3(0., 0., -1.);
226 return Vec3(0., -1., 0.);
237 return Vec3(0., 0., 1.);
248 return Vec3(-1., 0., 0.);
261 t = std::max(std::min(
t, 1.), 0.);
315 return Vec3(1., 0., 0.);
327 stream <<
"Vec3[" <<
x <<
", " <<
y <<
", " <<
z <<
"]";
351 return Vec3(0., 1., 0.);
376 return !(*
this ==
rhs);
#define THROW_INVALID_ARGUMENT_ERROR(msg)
Definition Error.hpp:37
Holds 1D and 2D arrays, the main work horse of the NumCpp library.
Definition NdArrayCore.hpp:139
self_type transpose() const
Definition NdArrayCore.hpp:4882
Holds a 2D vector.
Definition Vec2.hpp:49
Holds a 3D vector.
Definition Vec3.hpp:51
double z
Definition Vec3.hpp:56
std::string toString() const
Definition Vec3.hpp:324
bool operator==(const Vec3 &rhs) const noexcept
Definition Vec3.hpp:361
double distance(const Vec3 &otherVec) const noexcept
Definition Vec3.hpp:201
constexpr Vec3(const Vec2 &vec2) noexcept
Definition Vec3.hpp:103
Vec3(const std::initializer_list< double > &inList)
Definition Vec3.hpp:85
static constexpr Vec3 back() noexcept
Definition Vec3.hpp:152
Vec3(const NdArray< double > &ndArray)
Definition Vec3.hpp:115
static constexpr Vec3 down() noexcept
Definition Vec3.hpp:224
Vec3 clampMagnitude(double maxLength) const noexcept
Definition Vec3.hpp:165
double angle(const Vec3 &otherVec) const noexcept
Definition Vec3.hpp:134
Vec3 normalize() const noexcept
Definition Vec3.hpp:289
constexpr Vec3(double inX, double inY, double inZ) noexcept
Definition Vec3.hpp:72
double norm() const noexcept
Definition Vec3.hpp:278
Vec3 & operator-=(const Vec3 &rhs) noexcept
Definition Vec3.hpp:431
static constexpr Vec3 left() noexcept
Definition Vec3.hpp:246
double x
Definition Vec3.hpp:54
Vec3 & operator/=(double scalar) noexcept
Definition Vec3.hpp:461
Vec3 & operator-=(double scalar) noexcept
Definition Vec3.hpp:416
double y
Definition Vec3.hpp:55
Vec3 & operator*=(double scalar) noexcept
Definition Vec3.hpp:446
Vec3 project(const Vec3 &otherVec) const noexcept
Definition Vec3.hpp:301
bool operator!=(const Vec3 &rhs) const noexcept
Definition Vec3.hpp:374
static constexpr Vec3 up() noexcept
Definition Vec3.hpp:349
Vec3 lerp(const Vec3 &otherVec, double t) const noexcept
Definition Vec3.hpp:259
static constexpr Vec3 forward() noexcept
Definition Vec3.hpp:235
double dot(const Vec3 &otherVec) const noexcept
Definition Vec3.hpp:213
Vec3 & operator+=(const Vec3 &rhs) noexcept
Definition Vec3.hpp:401
NdArray< double > toNdArray() const
Definition Vec3.hpp:337
Vec3 & operator+=(double scalar) noexcept
Definition Vec3.hpp:386
Vec3 cross(const Vec3 &otherVec) const noexcept
Definition Vec3.hpp:185
static constexpr Vec3 right() noexcept
Definition Vec3.hpp:313
constexpr double interp(double inValue1, double inValue2, double inPercent) noexcept
Definition Utils/interp.hpp:41
bool essentiallyEqual(dtype inValue1, dtype inValue2) noexcept
Definition essentiallyEqual.hpp:49
Definition Cartesian.hpp:40
Duration operator-(const DateTime &lhs, const DateTime &rhs) noexcept
Subtraction operator.
Definition DateTime/DateTime.hpp:551
NdArray< dtype > operator/(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition NdArrayOperators.hpp:819
double hypot(dtype inValue1, dtype inValue2) noexcept
Definition hypot.hpp:56
std::ostream & operator<<(std::ostream &os, Duration duration)
Output stream operator for the Duration type.
Definition Clock.hpp:30
NdArrayConstIterator< dtype, PointerType, DifferenceType > operator+(typename NdArrayConstIterator< dtype, PointerType, DifferenceType >::difference_type offset, NdArrayConstIterator< dtype, PointerType, DifferenceType > next) noexcept
Definition NdArrayIterators.hpp:302
NdArray< dtype > arange(dtype inStart, dtype inStop, dtype inStep=1)
Definition arange.hpp:59
NdArray< dtype > operator*(const NdArray< dtype > &lhs, const NdArray< dtype > &rhs)
Definition NdArrayOperators.hpp:604