cpp_robotics::Vector3
3次元のベクトル More...
#include <vector3.hpp>
Public Types
Name | |
---|---|
using FLOATING_TYPE | value_type |
Public Functions
Name | |
---|---|
Vector3() =default Construct a new Vector 3 object. |
|
constexpr | Vector3(value_type vx, value_type vy, value_type vz) Construct a new Vector 3 object. |
Vector3(const Vector3 & v) =default Construct a new Vector 3 object. |
|
void | set(value_type vx, value_type vy, value_type vz) |
constexpr value_type | dot(const Vector3 & v) const |
constexpr Vector3 | cross(const Vector3 & v) const |
constexpr value_type | norm_sq() const |
value_type | norm() Get the Magnitude object. |
void | normalize() 単位ベクトル化 |
Vector3 | get_normalized() Get the Normalized object. |
constexpr bool | is_zero() const |
constexpr bool | has_nan() const |
constexpr Vector3 | lerp(const Vector3 & b, const value_type t) const |
constexpr Vector3 | operator+() const |
constexpr Vector3 | operator-() const |
bool | operator==(const Vector3 & v) const |
bool | operator!=(const Vector3 & v) const |
constexpr Vector3 | operator+(const Vector3 & v) const |
constexpr Vector3 | operator-(const Vector3 & v) const |
constexpr Vector3 & | operator+=(const Vector3 & v) |
constexpr Vector3 & | operator-=(const Vector3 & v) |
constexpr Vector3 & | operator*=(const value_type value) |
constexpr Vector3 & | operator/=(const value_type value) |
value_type & | operator[](const int index) |
constexpr value_type | operator[](const int index) const |
constexpr value_type | dot(const Vector3 & a, const Vector3 & b) |
value_type | distance(const Vector3 & a, const Vector3 & b) |
constexpr Vector3 | lerp(const Vector3 & a, const Vector3 & b, const value_type t) |
constexpr Vector3 | zero() |
constexpr Vector3 | forward() |
constexpr Vector3 | back() |
constexpr Vector3 | up() |
constexpr Vector3 | down() |
constexpr Vector3 | right() |
constexpr Vector3 | left() |
Public Attributes
Name | |
---|---|
value_type | x |
value_type | y |
value_type | z |
Friends
Name | |
---|---|
constexpr friend Vector3 | operator/(const Vector3 & v, const value_type value) |
constexpr friend Vector3 | operator*(const Vector3 & v, const Scaler s) |
constexpr friend Vector3 | operator*(const Scaler s, const Vector3 & v) |
Detailed Description
template <typename FLOATING_TYPE >
struct cpp_robotics::Vector3;
3次元のベクトル
Public Types Documentation
using value_type
using cpp_robotics::Vector3< FLOATING_TYPE >::value_type = FLOATING_TYPE;
Public Functions Documentation
function Vector3
Vector3() =default
Construct a new Vector 3 object.
function Vector3
inline constexpr Vector3(
value_type vx,
value_type vy,
value_type vz
)
Construct a new Vector 3 object.
Parameters:
- vx
- vy
- vz
function Vector3
Vector3(
const Vector3 & v
) =default
Construct a new Vector 3 object.
Parameters:
- v
function set
inline void set(
value_type vx,
value_type vy,
value_type vz
)
Parameters:
- vx
- vy
- vz
function dot
inline constexpr value_type dot(
const Vector3 & v
) const
Parameters:
- v
Return: constexpr value_type
function cross
inline constexpr Vector3 cross(
const Vector3 & v
) const
Parameters:
- v
Return: constexpr Vector3
function norm_sq
inline constexpr value_type norm_sq() const
Return: constexpr value_type
function norm
inline value_type norm()
Get the Magnitude object.
Return: value_type
function normalize
inline void normalize()
単位ベクトル化
function get_normalized
inline Vector3 get_normalized()
Get the Normalized object.
Return: Vector3
function is_zero
inline constexpr bool is_zero() const
Return:
- true
- false
function has_nan
inline constexpr bool has_nan() const
Return:
- true
- false
function lerp
inline constexpr Vector3 lerp(
const Vector3 & b,
const value_type t
) const
Parameters:
- b
- t
Return: constexpr Vector3
function operator+
inline constexpr Vector3 operator+() const
Return: constexpr Vector3
function operator-
inline constexpr Vector3 operator-() const
Return: constexpr Vector3
function operator==
inline bool operator==(
const Vector3 & v
) const
Parameters:
- v
Return:
- true
- false
function operator!=
inline bool operator!=(
const Vector3 & v
) const
Parameters:
- v
Return:
- true
- false
function operator+
inline constexpr Vector3 operator+(
const Vector3 & v
) const
Parameters:
- v
Return: Vector3
function operator-
inline constexpr Vector3 operator-(
const Vector3 & v
) const
Parameters:
- v
Return: Vector3
function operator+=
inline constexpr Vector3 & operator+=(
const Vector3 & v
)
Parameters:
- v
Return: Vector3&
function operator-=
inline constexpr Vector3 & operator-=(
const Vector3 & v
)
Parameters:
- v
Return: Vector3&
function operator*=
inline constexpr Vector3 & operator*=(
const value_type value
)
Parameters:
- value
Return: Vector3&
function operator/=
inline constexpr Vector3 & operator/=(
const value_type value
)
Parameters:
- value
Return: Vector3&
function operator[]
inline value_type & operator[](
const int index
)
Parameters:
- index
Return: value_type&
function operator[]
inline constexpr value_type operator[](
const int index
) const
Parameters:
- index
Return: constexpr value_type
function dot
static inline constexpr value_type dot(
const Vector3 & a,
const Vector3 & b
)
Parameters:
- a
- b
Return: constexpr value_type
function distance
static inline value_type distance(
const Vector3 & a,
const Vector3 & b
)
Parameters:
- a
- b
Return: value_type
function lerp
static inline constexpr Vector3 lerp(
const Vector3 & a,
const Vector3 & b,
const value_type t
)
Parameters:
- a
- b
- t
Return: constexpr Vector3
function zero
static inline constexpr Vector3 zero()
Return: Vector3
function forward
static inline constexpr Vector3 forward()
Return: Vector3
function back
static inline constexpr Vector3 back()
Return: Vector3
function up
static inline constexpr Vector3 up()
Return: Vector3
function down
static inline constexpr Vector3 down()
Return: Vector3
function right
static inline constexpr Vector3 right()
Return: Vector3
function left
static inline constexpr Vector3 left()
Return: Vector3
Public Attributes Documentation
variable x
value_type x;
variable y
value_type y;
variable z
value_type z;
Friends
friend operator/
friend constexpr friend Vector3 operator/(
const Vector3 & v,
const value_type value
);
Parameters:
- value
Return: Vector3
friend operator*
friend constexpr friend Vector3 operator*(
const Vector3 & v,
const Scaler s
);
Parameters:
- v
- s
Template Parameters:
- Scaler
Return: constexpr Vector3
friend operator*
friend constexpr friend Vector3 operator*(
const Scaler s,
const Vector3 & v
);
Parameters:
- s
- v
Template Parameters:
- Scaler
Return: constexpr Vector3
Updated on 2024-05-28 at 06:55:40 +0000