Inkscape
Vector Graphics Editor
Loading...
Searching...
No Matches
NR Namespace Reference

Classes

struct  Fvector
 a type of 3 gdouble components vectors More...
 

Functions

void convert_coord (gdouble &x, gdouble &y, gdouble &z, Geom::Affine const &trans)
 
gdouble norm (const Fvector &v)
 returns the euclidean norm of the vector v
 
void normalize_vector (Fvector &v)
 Normalizes a vector.
 
gdouble scalar_product (const Fvector &a, const Fvector &b)
 Computes the scalar product between two Fvectors.
 
void normalized_sum (Fvector &r, const Fvector &a, const Fvector &b)
 Computes the normalized sum of two Fvectors.
 
static const Fvector EYE_VECTOR (0, 0, 1)
 The eye vector.
 
void convert_coord (double &x, double &y, double &z, Geom::Affine const &trans)
 Applies the transformation matrix to (x, y, z).
 

Function Documentation

◆ convert_coord() [1/2]

void NR::convert_coord ( double &  x,
double &  y,
double &  z,
Geom::Affine const &  trans 
)

Applies the transformation matrix to (x, y, z).

This function assumes that trans[0] = trans[3]. x and y are transformed according to trans, z is multiplied by trans[0].

Parameters
xa reference to a x coordinate
ya reference to a y coordinate
za reference to a z coordinate
za reference to a transformation matrix

◆ convert_coord() [2/2]

void NR::convert_coord ( gdouble &  x,
gdouble &  y,
gdouble &  z,
Geom::Affine const &  trans 
)

◆ EYE_VECTOR()

static const Fvector NR::EYE_VECTOR ( ,
,
 
)
static

The eye vector.

◆ norm()

double NR::norm ( const Fvector v)

returns the euclidean norm of the vector v

Parameters
va reference to a vector with double components
Returns
the euclidean norm of v

Definition at line 30 of file nr-3dutils.cpp.

Referenced by normalize_vector().

◆ normalize_vector()

void NR::normalize_vector ( Fvector v)

Normalizes a vector.

Parameters
va reference to a vector to normalize

Definition at line 34 of file nr-3dutils.cpp.

References norm().

Referenced by Inkscape::Filters::PointLight::light_vector(), Inkscape::Filters::SpotLight::light_vector(), normalized_sum(), Inkscape::Filters::SpotLight::SpotLight(), and SurfaceSynth::surfaceNormalAt().

◆ normalized_sum()

void NR::normalized_sum ( Fvector r,
const Fvector a,
const Fvector b 
)

Computes the normalized sum of two Fvectors.

Parameters
ra Fvector reference where we store the result
aa Fvector reference
ba Fvector reference

Definition at line 48 of file nr-3dutils.cpp.

References normalize_vector().

◆ scalar_product()

double NR::scalar_product ( const Fvector a,
const Fvector b 
)

Computes the scalar product between two Fvectors.

Parameters
aa Fvector reference
ba Fvector reference
Returns
the scalar product of a and b

Definition at line 42 of file nr-3dutils.cpp.

Referenced by Inkscape::Filters::SpotLight::light_components().