Formula Student Autonomous Systems
The code for the main driverless system
Loading...
Searching...
No Matches
Plane Class Reference

The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0. More...

#include <plane.hpp>

Collaboration diagram for Plane:
Collaboration graph

Public Member Functions

 Plane (double a, double b, double c, double d)
 Constructs a new Plane object with the specified coefficients.
 
 Plane ()
 Constructs a new Plane object with default coefficients (0).
 
double get_a () const
 Getter - Get the a component of the plane.
 
double get_b () const
 Getter - Get the b component of the plane.
 
double get_c () const
 Getter - Get the c component of the plane.
 
double get_d () const
 Getter - Get the d component of the plane.
 
Planeoperator+= (const Plane &other)
 Overloads the += operator to add another plane to this plane.
 
Planeoperator/= (double scalar)
 Overloads the /= operator to divide a plane by a scalar.
 
double get_distance_to_point (float x, float y, float z) const
 Calculates the distance from a point to the plane.
 

Private Attributes

double a
 
double b
 
double c
 
double d
 

Detailed Description

The Plane class represents a 3D plane defined by its equation ax + by + cz + d = 0.

This class provides methods to manipulate and retrieve parameters of a plane, as well as calculate the distance from a point to the plane.

Definition at line 12 of file plane.hpp.

Constructor & Destructor Documentation

◆ Plane() [1/2]

Plane::Plane ( double  a,
double  b,
double  c,
double  d 
)

Constructs a new Plane object with the specified coefficients.

Parameters
aCoefficient 'a' of the plane equation.
bCoefficient 'b' of the plane equation.
cCoefficient 'c' of the plane equation.
dCoefficient 'd' of the plane equation.

Definition at line 3 of file plane.cpp.

◆ Plane() [2/2]

Plane::Plane ( )

Constructs a new Plane object with default coefficients (0).

Definition at line 5 of file plane.cpp.

Member Function Documentation

◆ get_a()

double Plane::get_a ( ) const

Getter - Get the a component of the plane.

Returns
double a component

Definition at line 7 of file plane.cpp.

Here is the caller graph for this function:

◆ get_b()

double Plane::get_b ( ) const

Getter - Get the b component of the plane.

Returns
double b component

Definition at line 9 of file plane.cpp.

Here is the caller graph for this function:

◆ get_c()

double Plane::get_c ( ) const

Getter - Get the c component of the plane.

Returns
double c component

Definition at line 11 of file plane.cpp.

Here is the caller graph for this function:

◆ get_d()

double Plane::get_d ( ) const

Getter - Get the d component of the plane.

Returns
double d component

Definition at line 13 of file plane.cpp.

◆ get_distance_to_point()

double Plane::get_distance_to_point ( float  x,
float  y,
float  z 
) const

Calculates the distance from a point to the plane.

Parameters
pointThe point for which the distance to the plane is calculated.
Returns
The distance from the point to the plane.

Definition at line 15 of file plane.cpp.

Here is the caller graph for this function:

◆ operator+=()

Plane & Plane::operator+= ( const Plane other)

Overloads the += operator to add another plane to this plane.

Parameters
otherThe plane to be added.
Returns
Reference to the modified plane.

Definition at line 21 of file plane.cpp.

◆ operator/=()

Plane & Plane::operator/= ( double  scalar)

Overloads the /= operator to divide a plane by a scalar.

Parameters
scalarThe scalar to divide the plane.
Returns
Reference to the modified plane.

Definition at line 29 of file plane.cpp.

Member Data Documentation

◆ a

double Plane::a
private

Definition at line 81 of file plane.hpp.

◆ b

double Plane::b
private

Definition at line 82 of file plane.hpp.

◆ c

double Plane::c
private

Definition at line 83 of file plane.hpp.

◆ d

double Plane::d
private

Definition at line 84 of file plane.hpp.


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