atomicrex
0.1
An advanced atomistic model building tool
|
A point in 3d space. More...
#include <Point3.h>
Classes | |
struct | Origin |
An empty type that denotes the point (0,0,0). More... | |
Public Member Functions | |
Point_3 () | |
Constructs a point without initializing its components. The components will have an undefined value! | |
constexpr | Point_3 (T val) |
Constructs a point with all three components initialized to the given value. | |
Related Functions | |
(Note that these are not member functions.) | |
using | Point3 = Point_3< FloatType > |
Instantiation of the Point_3 class template with the default floating-point type. | |
using | Point3I = Point_3< int > |
Instantiation of the Point_3 class template with the default integer type. | |
template<typename T > | |
constexpr Point_3< T > | operator+ (const Point_3< T > &a, const Vector_3< T > &b) |
Computes the sum of a point and a vector. More... | |
template<typename T > | |
constexpr const Point_3< T > & | operator+ (typename Point_3< T >::Origin, const Vector_3< T > &b) |
Converts a vector to a point. More... | |
template<typename T > | |
constexpr Point_3< T > | operator+ (const Vector_3< T > &a, const Point_3< T > &b) |
Computes the sum of a vector and a point. More... | |
template<typename T > | |
constexpr Point_3< T > | operator- (const Point_3< T > &a, const Vector_3< T > &b) |
Subtracts a vector from a point. More... | |
template<typename T > | |
constexpr Vector_3< T > | operator- (const Point_3< T > &a, const Point_3< T > &b) |
Computes the vector connecting to two points. More... | |
template<typename T > | |
constexpr Point_3< T > | operator* (const Point_3< T > &a, T s) |
Computes the component-wise product of a point and a scalar value. More... | |
template<typename T > | |
constexpr Point_3< T > | operator* (T s, const Point_3< T > &a) |
Computes the component-wise product of a point and a scalar value. More... | |
template<typename T > | |
constexpr Point_3< T > | operator/ (const Point_3< T > &a, T s) |
Computes the component-wise division of a point by a scalar value. More... | |
template<typename T > | |
std::ostream & | operator<< (std::ostream &os, const Point_3< T > &v) |
Writes a point to a text output stream. More... | |
A point in 3d space.
Point_3 represents a point in three-dimensional space with three coordinates x,y, and z. Note that there exists a corresponding class Vector_3, which represents a vector in three-dimensional space.
The template parameter T specifies the data type of the points's components. Two standard instantiations of Point_3 for floating-point and integer coordinates are predefined:
Point_3 derives from std::array<T,3>. Thus, the point coordinates can be accessed via indices, but also via names:
Note that the default constructor does not initialize the components of the point for performance reasons. The nested type Origin can be used to construct the point (0,0,0):
Origin can also be used to convert between points and vectors:
Note that points and vectors behave differently under affine transformations:
Computes the component-wise product of a point and a scalar value.
Computes the component-wise product of a point and a scalar value.
|
related |
Computes the sum of a point and a vector.
|
related |
Converts a vector to a point.
|
related |
Computes the sum of a vector and a point.
|
related |
Subtracts a vector from a point.
|
related |
Computes the vector connecting to two points.
Computes the component-wise division of a point by a scalar value.
|
related |
Writes a point to a text output stream.