Point

class Point

Point in 3D space.

Public Functions

Point()

Construct point at origin.

explicit Point(double x, double y = 0, double z = 0)

Construct point with given coordinates.

bool is_equal(const Point &other, double tol = 1e-15) const

Check if two points are equal within a tolerance.

Parameters:
  • other – Other point

  • tol – Tolerance

Returns:

true if points are equal within tolerance

Point operator+(const Point &v) const

Add two points.

Parameters:

vPoint to add

Returns:

Point (this + v)

Vector operator-(const Point &v) const

Compute vector from two points.

Parameters:
  • a – First point

  • b – Second point

Returns:

Vector (this - b)

Public Members

double x

X-component.

double y

Y-component.

double z

Z-component.