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.Normal Struct Reference

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

Public Member Functions

 Normal ()
 Empty constructor.
 
 Normal (float x, float y, float z)
 Constructor with float parameters. More...
 
override string ToString ()
 Returns normal's components x, y, z as a string. More...
 
Vec ToVec ()
 Returns the Normal as a Vec.
 
Normal Neg ()
 Invert the direction of a normal. More...
 
Normal NormalizeNormal ()
 Normalize the normal, so that it's norm is equal to 1. More...
 

Static Public Member Functions

static bool are_close (Normal p, Normal q)
 Check if two normals are similar enough to be considered equal.
 
static Normal operator* (Normal n, float s)
 Returns the product between a vector and a scalar. More...
 
static float VecDotNormal (Vec v, Normal w)
 Returns the dot product between a vector and a normal. More...
 
static Vec VecCrossNormal (Vec v, Normal w)
 Returns the cross product between a vector and a normal. More...
 
static Normal NormalCrossNormal (Normal v, Normal w)
 Returns the cross product between two normals. More...
 
static float SquaredNorm (Normal n)
 Returns the squared norm of a normal. More...
 
static float Norm (Normal n)
 Returns the norm of a normal. More...
 

Public Attributes

float x
 
float y
 
float z
 

Detailed Description

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

Constructor & Destructor Documentation

◆ Normal()

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

Constructor with float parameters.

Parameters
x
y
z

Member Function Documentation

◆ Neg()

Normal PGENLib.Normal.Neg ( )

Invert the direction of a normal.

Returns

◆ Norm()

static float PGENLib.Normal.Norm ( Normal  n)
static

Returns the norm of a normal.

Parameters
n
Returns

◆ NormalCrossNormal()

static Normal PGENLib.Normal.NormalCrossNormal ( Normal  v,
Normal  w 
)
static

Returns the cross product between two normals.

Parameters
v
w
Returns

◆ NormalizeNormal()

Normal PGENLib.Normal.NormalizeNormal ( )

Normalize the normal, so that it's norm is equal to 1.

Returns

◆ operator*()

static Normal PGENLib.Normal.operator* ( Normal  n,
float  s 
)
static

Returns the product between a vector and a scalar.

Parameters
n
s
Returns

◆ SquaredNorm()

static float PGENLib.Normal.SquaredNorm ( Normal  n)
static

Returns the squared norm of a normal.

Parameters
n
Returns

◆ ToString()

override string PGENLib.Normal.ToString ( )

Returns normal's components x, y, z as a string.

Returns

◆ VecCrossNormal()

static Vec PGENLib.Normal.VecCrossNormal ( Vec  v,
Normal  w 
)
static

Returns the cross product between a vector and a normal.

Parameters
v
w
Returns

◆ VecDotNormal()

static float PGENLib.Normal.VecDotNormal ( Vec  v,
Normal  w 
)
static

Returns the dot product between a vector and a normal.

Parameters
v
w
Returns

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