A 3D vector. This class has three floating-point fields: x, y, and z.
More...
|
|
static bool | are_close (Vec p, Vec q) |
| | Check if two vectors are similar enough to be considered equal.
|
| |
| static Vec | operator+ (Vec v, Vec w) |
| | Returns the sum of two vectors. More...
|
| |
| static Vec | operator- (Vec v, Vec w) |
| | Returns the difference between two vectors. More...
|
| |
| static Vec | operator* (Vec v, float s) |
| | Returns the product between a vector and a scalar. More...
|
| |
| static Vec | operator/ (Vec v, float s) |
| | Returns the division between a vector and a float, which is a vector. More...
|
| |
| static Vec | operator- (Vec a) |
| | Return the reversed vector. More...
|
| |
| static float | DotProd (Vec v, Vec w) |
| | Returns the dot product between two vectors. More...
|
| |
| static Vec | CrossProduct (Vec v, Vec w) |
| | Returns the cross product between two vectors. More...
|
| |
| static float | SquaredNorm (Vec v) |
| | Return the squared norm (Euclidean length) of a vector. More...
|
| |
| static float | Norm (Vec v) |
| | Return the norm (Euclidean length) of a vector. More...
|
| |
| static Tuple | CreateOnbFromZ (Normal e3) |
| | Create a orthonormal basis (Onb) from a vector representing the z axis (which must be normalized). More...
|
| |
| static float | NormalizeDot (Vec v1, Vec v2) |
| | Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals. More...
|
| |
| static float | NormalizeDot (Normal v1, Normal v2) |
| | Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals. More...
|
| |
| static float | NormalizeDot (Normal v1, Vec v2) |
| | Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals. More...
|
| |
| static float | NormalizeDot (Vec v1, Normal v2) |
| | Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals. More...
|
| |
A 3D vector. This class has three floating-point fields: x, y, and z.
◆ Vec()
| PGENLib.Vec.Vec |
( |
float |
x, |
|
|
float |
y, |
|
|
float |
z |
|
) |
| |
Constructor with float parameters.
- Parameters
-
◆ CreateOnbFromZ()
Create a orthonormal basis (Onb) from a vector representing the z axis (which must be normalized).
- Parameters
-
| e3 | normalized Normal vector, on the z axis |
- Returns
- Tuple containing the three vectors of the basis, such that e3 = normal
◆ CrossProduct()
| static Vec PGENLib.Vec.CrossProduct |
( |
Vec |
v, |
|
|
Vec |
w |
|
) |
| |
|
static |
Returns the cross product between two vectors.
- Parameters
-
- Returns
◆ DotProd()
| static float PGENLib.Vec.DotProd |
( |
Vec |
v, |
|
|
Vec |
w |
|
) |
| |
|
static |
Returns the dot product between two vectors.
- Parameters
-
- Returns
◆ Neg()
Return the reversed vector.
- Returns
◆ Norm()
| static float PGENLib.Vec.Norm |
( |
Vec |
v | ) |
|
|
static |
Return the norm (Euclidean length) of a vector.
- Parameters
-
- Returns
◆ NormalizeDot() [1/4]
| static float PGENLib.Vec.NormalizeDot |
( |
Normal |
v1, |
|
|
Normal |
v2 |
|
) |
| |
|
static |
Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals.
- Parameters
-
- Returns
- a float representing the cosine of the angle between the two vecors/normals.
◆ NormalizeDot() [2/4]
| static float PGENLib.Vec.NormalizeDot |
( |
Normal |
v1, |
|
|
Vec |
v2 |
|
) |
| |
|
static |
Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals.
- Parameters
-
- Returns
- a float representing the cosine of the angle between the two vecors/normals.
◆ NormalizeDot() [3/4]
| static float PGENLib.Vec.NormalizeDot |
( |
Vec |
v1, |
|
|
Normal |
v2 |
|
) |
| |
|
static |
Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals.
- Parameters
-
- Returns
- a float representing the cosine of the angle between the two vecors/normals.
◆ NormalizeDot() [4/4]
| static float PGENLib.Vec.NormalizeDot |
( |
Vec |
v1, |
|
|
Vec |
v2 |
|
) |
| |
|
static |
Normalize two vectors or normals and evaluate the dot product. The result is the cosine of the angle between the two vectors/normals.
- Parameters
-
- Returns
- a float representing the cosine of the angle between the two vecors/normals.
◆ NormalizeVec()
| Vec PGENLib.Vec.NormalizeVec |
( |
| ) |
|
Normalize the vector, so that it's norm is equal to 1.
- Returns
◆ operator*()
| static Vec PGENLib.Vec.operator* |
( |
Vec |
v, |
|
|
float |
s |
|
) |
| |
|
static |
Returns the product between a vector and a scalar.
- Parameters
-
- Returns
◆ operator+()
| static Vec PGENLib.Vec.operator+ |
( |
Vec |
v, |
|
|
Vec |
w |
|
) |
| |
|
static |
Returns the sum of two vectors.
- Parameters
-
- Returns
◆ operator-() [1/2]
| static Vec PGENLib.Vec.operator- |
( |
Vec |
a | ) |
|
|
static |
Return the reversed vector.
- Parameters
-
- Returns
◆ operator-() [2/2]
| static Vec PGENLib.Vec.operator- |
( |
Vec |
v, |
|
|
Vec |
w |
|
) |
| |
|
static |
Returns the difference between two vectors.
- Parameters
-
- Returns
◆ operator/()
| static Vec PGENLib.Vec.operator/ |
( |
Vec |
v, |
|
|
float |
s |
|
) |
| |
|
static |
Returns the division between a vector and a float, which is a vector.
- Parameters
-
- Returns
- a vector
◆ SquaredNorm()
| static float PGENLib.Vec.SquaredNorm |
( |
Vec |
v | ) |
|
|
static |
Return the squared norm (Euclidean length) of a vector.
- Parameters
-
- Returns
◆ ToString()
| override string PGENLib.Vec.ToString |
( |
| ) |
|
Returns vector's components x, y, z as a string.
- Returns
◆ VecToNorm()
| Normal PGENLib.Vec.VecToNorm |
( |
| ) |
|
Turns a vector in a normal, and returns the normal.
- Returns
The documentation for this struct was generated from the following file:
- /Users/fra/Documenti/Università/Magistrale/SNIF/PhotoGENius/PGENLib/Geometry.cs