Guillaume 1.0.0
Guillaume.
Loading...
Searching...
No Matches
Point Class Reference

Represents a point in 3D space. More...

#include <point.hpp>

Inheritance diagram for Point:
Collaboration diagram for Point:

Public Member Functions

 Point (void)
 Default constructor - initializes point at the origin (0,0,0)
 
 Point (float x, float y)
 Constructor from 2D coordinates.
 
 Point (float x, float y, float z)
 Constructor from coordinates.
 
float x (void) const
 Access the x-coordinate of the point.
 
float y (void) const
 Access the y-coordinate of the point.
 
float z (void) const
 Access the z-coordinate of the point.
 
float getX (void) const
 Get the x-coordinate of the point (alias for x())
 
float getY (void) const
 Get the y-coordinate of the point (alias for y())
 
float getZ (void) const
 Get the z-coordinate of the point (alias for z())
 
- Public Member Functions inherited from Vector< float, 3 >
 Vector ()
 Default constructor - initializes all components to zero.
 
 Vector (std::initializer_list< float > values)
 Constructor from initializer list.
 
float & operator[] (size_t index)
 Non-const element access operator.
 
const float & operator[] (size_t index) const
 Const element access operator.
 
Vector operator+ (const Vector &other) const
 Vector addition operator.
 
Vector operator- (const Vector &other) const
 Vector subtraction operator.
 
Vector operator* (float scalar) const
 Scalar multiplication operator.
 
float dot (const Vector &other) const
 Compute dot product with another vector.
 
float magnitude () const
 Calculate the magnitude (length) of the vector.
 
Vector normalize () const
 Create a normalized (unit) vector.
 
constexpr size_t size () const
 Get the number of dimensions/components.
 

Detailed Description

Represents a point in 3D space.

The Point class is a simple wrapper around a 3D vector to represent a point in space. It provides constructors for initialization and access to the underlying vector components.

Constructor & Destructor Documentation

◆ Point() [1/2]

Point::Point ( float  x,
float  y 
)
inline

Constructor from 2D coordinates.

Initializes the point with the specified x and y coordinates, z defaults to 0.

Parameters
xThe x-coordinate of the point
yThe y-coordinate of the point

◆ Point() [2/2]

Point::Point ( float  x,
float  y,
float  z 
)
inline

Constructor from coordinates.

Initializes the point with the specified x, y, and z coordinates.

Parameters
xThe x-coordinate of the point
yThe y-coordinate of the point
zThe z-coordinate of the point

Member Function Documentation

◆ getX()

float Point::getX ( void  ) const
inline

Get the x-coordinate of the point (alias for x())

Returns
The x-coordinate

◆ getY()

float Point::getY ( void  ) const
inline

Get the y-coordinate of the point (alias for y())

Returns
The y-coordinate

◆ getZ()

float Point::getZ ( void  ) const
inline

Get the z-coordinate of the point (alias for z())

Returns
The z-coordinate

◆ x()

float Point::x ( void  ) const
inline

Access the x-coordinate of the point.

Returns
The x-coordinate

◆ y()

float Point::y ( void  ) const
inline

Access the y-coordinate of the point.

Returns
The y-coordinate

◆ z()

float Point::z ( void  ) const
inline

Access the z-coordinate of the point.

Returns
The z-coordinate

The documentation for this class was generated from the following file: