A struct representing a point in 3D space.
More...
#include <point.h>
|
|
| Point () |
| | Construct a new Point object at the origin.
|
| | Point (float x_, float y_) |
| | Construct a new Point object at the specified coordinates (z defaults to 0)
|
| | Point (float x_, float y_, float z_) |
| | Construct a new Point object at the specified coordinates.
|
| float | length () const |
| | Calculate the length of the vector from the origin to this point.
|
| float | distance (const Point &other) const |
| | Calculate the distance between this point and another point.
|
|
Point | operator- (const Point &other) const |
|
Point | operator+ (const Point &other) const |
|
Point | operator* (float scalar) const |
|
bool | operator== (const Point &other) const |
|
void | operator+= (const Point &other) |
|
void | operator/= (float scalar) |
|
void | operator*= (float scalar) |
|
|
float | x |
|
float | y |
|
float | z |
| | Coordinates of the point.
|
|
| std::ostream & | operator<< (std::ostream &os, const Point &p) |
| | Overload the << operator to print the point's coordinates.
|
A struct representing a point in 3D space.
◆ Point() [1/2]
| Point::Point |
( |
float | x_, |
|
|
float | y_ ) |
|
inline |
Construct a new Point object at the specified coordinates (z defaults to 0)
- Parameters
-
◆ Point() [2/2]
| Point::Point |
( |
float | x_, |
|
|
float | y_, |
|
|
float | z_ ) |
|
inline |
Construct a new Point object at the specified coordinates.
- Parameters
-
◆ distance()
| float Point::distance |
( |
const Point & | other | ) |
const |
Calculate the distance between this point and another point.
- Parameters
-
- Returns
- float distance between the points
◆ length()
| float Point::length |
( |
| ) |
const |
Calculate the length of the vector from the origin to this point.
- Returns
- float length of the vector
◆ operator<<
| std::ostream & operator<< |
( |
std::ostream & | os, |
|
|
const Point & | p ) |
|
friend |
Overload the << operator to print the point's coordinates.
- Parameters
-
- Returns
- std::ostream&
The documentation for this struct was generated from the following files:
- include/geometry/point.h
- src/geometry/point.cpp