PhotoGENius V1.0.0
A basic library for generating photorealistic images, developed for the course Numerical techniques for photorealistic image generation.
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
PGENLib.Point Struct Reference

A point in 3D space. This struct has three floating-point fields: x, y, and z. More...

Public Member Functions

 Point ()
 Empty constructor.
 
 Point (float x, float y, float z)
 Constructor with float parameters. More...
 
override string ToString ()
 Returns point's components x, y, z as a string.
 
Vec PointToVec ()
 Turns a point into a vector and returns it. More...
 

Static Public Member Functions

static bool are_close (Point p, Point q)
 Check if two points are similar enough to be considered equal.

 
static Point operator+ (Point p, Vec v)
 Return the sum between a point and a vector, which is a point. More...
 
static Point operator* (Point p, float a)
 Returns the product between a point and a scalar. More...
 
static Vec operator- (Point p, Point q)
 Returns the difference between two points, as a vector. More...
 
static Point operator- (Point p, Vec v)
 Return the difference between a point and a vector, as point. More...
 
static Point operator/ (Point v, float s)
 Returns the division between a point and a scalar. More...
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

A point in 3D space. This struct has three floating-point fields: x, y, and z.

Constructor & Destructor Documentation

◆ Point()

PGENLib.Point.Point ( float  x,
float  y,
float  z 
)

Constructor with float parameters.

Parameters
x
y
z

Member Function Documentation

◆ operator*()

static Point PGENLib.Point.operator* ( Point  p,
float  a 
)
static

Returns the product between a point and a scalar.

Parameters
p
a
Returns

◆ operator+()

static Point PGENLib.Point.operator+ ( Point  p,
Vec  v 
)
static

Return the sum between a point and a vector, which is a point.

Parameters
p
v
Returns
point

◆ operator-() [1/2]

static Vec PGENLib.Point.operator- ( Point  p,
Point  q 
)
static

Returns the difference between two points, as a vector.

Parameters
p
q
Returns
vector

◆ operator-() [2/2]

static Point PGENLib.Point.operator- ( Point  p,
Vec  v 
)
static

Return the difference between a point and a vector, as point.

Parameters
p
v
Returns

◆ operator/()

static Point PGENLib.Point.operator/ ( Point  v,
float  s 
)
static

Returns the division between a point and a scalar.

Parameters
v
s
Returns

◆ PointToVec()

Vec PGENLib.Point.PointToVec ( )

Turns a point into a vector and returns it.

Returns

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