![]() |
levelz-cpp 0.2.0
|
#include <coordinate.hpp>
Public Member Functions | |
Coordinate3D () | |
Coordinate3D (int x, int y, int z) | |
Coordinate3D (double x, double y, double z) | |
Coordinate3D (std::vector< int > xyz) | |
Coordinate3D (std::array< int, 3 > xyz) | |
Coordinate3D (std::vector< double > xyz) | |
Coordinate3D (std::array< double, 3 > xyz) | |
double | getMagnitude () const |
bool | operator== (const Coordinate3D &other) const |
bool | operator!= (const Coordinate3D &other) const |
Coordinate3D | operator+ (const Coordinate3D &other) const |
Coordinate3D | operator- (const Coordinate3D &other) const |
Coordinate3D | operator* (int scalar) const |
Coordinate3D | operator/ (int scalar) const |
std::string | to_string () const |
std::ostream & | operator<< (std::ostream &strm) |
![]() |
Static Public Member Functions | |
static Coordinate3D | from_string (const std::string &str) |
Public Attributes | |
double | x |
double | y |
double | z |
Represents a 3D coordinate.
|
inline |
Initializes a new instance of the Coordinate3D class at [0, 0, 0].
|
inline |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
x | The X coordinate. |
y | The Y coordinate. |
z | The Z coordinate. |
|
inline |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
x | The X coordinate. |
y | The Y coordinate. |
z | The Z coordinate. |
|
inlineexplicit |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
xyz | The X, Y, and Z coordinates in a vector. |
|
inlineexplicit |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
xyz | The X, Y, and Z coordinates in an array. |
|
inlineexplicit |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
xyz | The X, Y, and Z coordinates in a vector. |
|
inlineexplicit |
Initializes a new instance of the Coordinate3D class at the specified coordinates.
xyz | The X, Y, and Z coordinates in an array. |
|
inlinestatic |
Converts a string to a 3D coordinate.
str | The string to convert. |
|
inlinevirtual |
|
inline |
Compares two coordinates for inequality.
other | The other coordinate to compare to. |
|
inline |
Multiplies the coordinate by a scalar.
scalar | The scalar to multiply by. |
|
inline |
Adds two coordinates together.
other | The other coordinate to add. |
|
inline |
Subtracts one coordinate from another.
other | The other coordinate to subtract. |
|
inline |
Divides the coordinate by a scalar.
scalar | The scalar to divide by. |
|
inline |
Overloads the << operator to allow for easy printing of a Coordinate3D.
strm | The output stream to write to. |
|
inline |
Compares two coordinates for equality.
other | The other coordinate to compare to. |
|
inlinevirtual |
Converts this 3D coordinate to a string.
Implements LevelZ::Coordinate.
double LevelZ::Coordinate3D::x |
The X coordinate.
double LevelZ::Coordinate3D::y |
The Y coordinate.
double LevelZ::Coordinate3D::z |
The Z coordinate.