|
GOAT (Geometrical optics application tool) 0.1
|
This class represents a single ray. More...
#include <iray.h>
Public Member Functions | |
| bool | checkObjectIntersection (int &Index, maths::Vector< double > &Pmin) |
| double | cross (const maths::Vector< double > P10, const maths::Vector< double > P11, const maths::Vector< double > P20, const maths::Vector< double > P21) |
| maths::Vector< double > | crossPlane (const maths::Vector< double > Pe, const maths::Vector< double > n) |
| calculates the intersection point between the ray and a plane, which is defined by the vector P and the normal n | |
| int | currentObjectIndex () |
| returns the index of the hidden object or -1 | |
| maths::Matrix< std::complex< double > > | Fresnel_reflect (double alpha, std::complex< double > n1, std::complex< double > n2) |
| returns Fresnel matrix for the reflection calculation (alpha: angle of incidence, n1,n2 are the refractive indices) | |
| maths::Matrix< std::complex< double > > | Fresnel_trans (double alpha, std::complex< double > beta, std::complex< double > n1, std::complex< double > n2) |
| returns Fresnel matrix for the transmission calculation (alpha: angle of incidence, n1,n2 are the refractive indices) | |
| maths::Vector< std::complex< double > > | getE () |
| gives back electric field strength | |
| maths::Vector< double > | getk () |
| Returns the direction of the ray. | |
| ObjectShape * | getObject (int i) |
| Returns the i-th object (for internal use only) | |
| maths::Vector< double > | getP () |
| Returns the current position of the ray. | |
| std::complex< double > | getRefract () |
| Returns the current refractive index. | |
| void | initElectricField (const maths::Vector< std::complex< double > > &PolS, const maths::Vector< std::complex< double > > &PolP, const int AnzRays) |
| initialises the electric field vectors with help of polarisation vectors PolS and PolP, numOfRays can be omitted | |
| void | initElectricField (const Plane &Eb, const maths::Vector< std::complex< double > > &Pol, const int numOfRays=1) |
| initialises the electric field with help of the Plane Eb and the polarisation Pol, numOfRays can be omitted. (Here, only one polarisation is given, the other is skipped) | |
| void | initElectricField (const Plane &Eb, const maths::Vector< std::complex< double > > &Pol1, const maths::Vector< std::complex< double > > &Pol2, const int AnzRays) |
| void | initElectricFieldGauss (const Plane &Eb, const maths::Vector< std::complex< double > > &PolS, const maths::Vector< std::complex< double > > &PolP, Gauss g) |
| Initialises the ray for gaussian beam with help of the plane Eb and the polarisation vectors PolS and PolP. The parameters for the gaussian beam are stored in g. | |
| void | initElectricFieldGauss (double sigma2, maths::Vector< double > focuspos, maths::Vector< std::complex< double > > Pol) |
| void | initElectricFieldGauss (maths::Vector< std::complex< double > > &Pol, Gauss g) |
| Initialises the ray for gaussian beam with help of the plane Eb and the polarisation vector Pol (second polarisation is not used, E2 is set to E1). The parameters for the gaussian beam are stored in g. | |
| maths::Vector< double > | intersectRect (const maths::Vector< double > P, const maths::Vector< double > e1, const maths::Vector< double > e2) |
| IRay () | |
| IRay (const IRay &r) | |
| IRay (const maths::Vector< double > &p, const maths::Vector< std::complex< double > > &Pol, const maths::Vector< double > &K, std::complex< double > n0, double r0, double k0, const int numObj=0, std::vector< ObjectShape * > obj=std::vector< ObjectShape * >()) | |
| Contructor. | |
| bool | isInObject () |
| Returns true if ray is inside an object. | |
| bool | next () |
| make the next step (has to include phase progress) | |
| int | objectIndex () |
| Returns the index of the last hidden object (or -1 if no object was hidden) | |
| maths::Vector< std::complex< double > > | Pol1 () |
| direction of the first polarisation | |
| maths::Vector< std::complex< double > > | Pol2 () |
| direction of the second polarisation | |
| IRay | reflect (maths::Vector< double > n, std::complex< double > n1, std::complex< double > n2) |
| This function reflects ray on the surface. Here, the ray is reflected and the transmitted ray is created. | |
| int | reflections () |
| Returns the number of reflections the beam has already passed through. | |
| void | reflectRay (RayBase *&tray, maths::Vector< double > n, std::complex< double > n1, std::complex< double > n2) |
| Reflects ray on the surface /param tray Transmitted (=refracted) ray /param n Surface normal /param n1 Refractive index (incident side) /param n2 Refractive index (transmitted side) | |
| void | refract (maths::Vector< double > N, std::complex< double > n1, std::complex< double > n2) |
| This function refracts the ray on the surface. | |
| void | setiR (int i) |
| Sets the current reflexion counter (for internal use only) | |
| void | setk (const maths::Vector< double > &K) |
| Sets the direction of the ray. | |
| void | setP (const maths::Vector< double > &p) |
| Current position of the ray. | |
| void | setRefract (std::complex< double > n) |
| Sets the current refractive index. | |
| ~IRay () | |
Public Attributes | |
| maths::Vector< std::complex< double > > | E1 |
| maths::Vector< std::complex< double > > | E2 |
| electric fields | |
| maths::Vector< double > | k |
| current direction | |
| maths::Vector< double > | P |
| current position | |
| Public Attributes inherited from GOAT::raytracing::RayBase | |
| bool | inObject =false |
| is in an object | |
| int | iR =0 |
| number of reflections already done | |
| double | k0 =2.0*M_PI |
| wave number | |
| std::complex< double > | n |
| std::complex< double > | n0 |
| current refractive index and refractive index of the host material | |
| int | numObj =0 |
| number of objects | |
| std::vector< ObjectShape * > | Obj |
| list of all objects | |
| int | objIndex =0 |
| index of the current object | |
| double | r0 =1.0 |
| double | rc =1.0 |
| radius of the calculation sphere | |
| int | status = RAYBASE_STATUS_NONE |
| bool | suppress_phase_progress =false |
| suppress phase change in next(), needed for short pulse consideration | |
| RayBase * | tray =0 |
| transmitted ray (used by the raytracer, for internal use only) | |
Protected Attributes | |
| bool | isValid |
| double | KORR |
| maths::Vector< double > | OK |
Friends | |
| std::ostream & | operator<< (std::ostream &os, IRay S) |
This class represents a single ray.
This ray is intended to calculate with a single ray with two different polarisations. This class should not be used directly. It is intended for use together with classes derived by LightSrc (like LightSrcPlane or LightSrcGauss)
| GOAT::raytracing::IRay::IRay | ( | ) |
| GOAT::raytracing::IRay::IRay | ( | const maths::Vector< double > & | p, |
| const maths::Vector< std::complex< double > > & | Pol, | ||
| const maths::Vector< double > & | K, | ||
| std::complex< double > | n0, | ||
| double | r0, | ||
| double | k0, | ||
| const int | numObj = 0, | ||
| std::vector< ObjectShape * > | obj = std::vector< ObjectShape * >() ) |
Contructor.
| p | Position of the ray |
| Pol | Polarisation (in the moment not used) |
| K | direction of the ray |
| n0 | refractive index |
| r0 | radius of the calculation sphere |
| k0 | wavenumber (=2*pi/wavelength in vacuum) |
| numObj | number of objects |
| obj | list of the objects |
| GOAT::raytracing::IRay::~IRay | ( | ) |
| bool GOAT::raytracing::IRay::checkObjectIntersection | ( | int & | Index, |
| maths::Vector< double > & | Pmin ) |
Checks wether there is an intersection between the ray and an object or not. In case of an intersection the function returns true and Index is set to the index of the object within the object list and Pmin gives the (nearest) intersection point
| double GOAT::raytracing::IRay::cross | ( | const maths::Vector< double > | P10, |
| const maths::Vector< double > | P11, | ||
| const maths::Vector< double > | P20, | ||
| const maths::Vector< double > | P21 ) |
| maths::Vector< double > GOAT::raytracing::IRay::crossPlane | ( | const maths::Vector< double > | Pe, |
| const maths::Vector< double > | n ) |
calculates the intersection point between the ray and a plane, which is defined by the vector P and the normal n
|
inline |
| maths::Matrix< std::complex< double > > GOAT::raytracing::IRay::Fresnel_reflect | ( | double | alpha, |
| std::complex< double > | n1, | ||
| std::complex< double > | n2 ) |
returns Fresnel matrix for the reflection calculation (alpha: angle of incidence, n1,n2 are the refractive indices)
| maths::Matrix< std::complex< double > > GOAT::raytracing::IRay::Fresnel_trans | ( | double | alpha, |
| std::complex< double > | beta, | ||
| std::complex< double > | n1, | ||
| std::complex< double > | n2 ) |
returns Fresnel matrix for the transmission calculation (alpha: angle of incidence, n1,n2 are the refractive indices)
|
inlinevirtual |
gives back electric field strength
Implements GOAT::raytracing::RayBase.
|
inlinevirtual |
Returns the direction of the ray.
Implements GOAT::raytracing::RayBase.
|
inline |
|
inlinevirtual |
Returns the current position of the ray.
Implements GOAT::raytracing::RayBase.
|
inline |
| void GOAT::raytracing::IRay::initElectricField | ( | const maths::Vector< std::complex< double > > & | PolS, |
| const maths::Vector< std::complex< double > > & | PolP, | ||
| const int | AnzRays ) |
initialises the electric field vectors with help of polarisation vectors PolS and PolP, numOfRays can be omitted
| void GOAT::raytracing::IRay::initElectricField | ( | const Plane & | Eb, |
| const maths::Vector< std::complex< double > > & | Pol, | ||
| const int | numOfRays = 1 ) |
initialises the electric field with help of the Plane Eb and the polarisation Pol, numOfRays can be omitted. (Here, only one polarisation is given, the other is skipped)
| void GOAT::raytracing::IRay::initElectricField | ( | const Plane & | Eb, |
| const maths::Vector< std::complex< double > > & | Pol1, | ||
| const maths::Vector< std::complex< double > > & | Pol2, | ||
| const int | AnzRays ) |
| void GOAT::raytracing::IRay::initElectricFieldGauss | ( | const Plane & | Eb, |
| const maths::Vector< std::complex< double > > & | PolS, | ||
| const maths::Vector< std::complex< double > > & | PolP, | ||
| Gauss | g ) |
Initialises the ray for gaussian beam with help of the plane Eb and the polarisation vectors PolS and PolP. The parameters for the gaussian beam are stored in g.
| void GOAT::raytracing::IRay::initElectricFieldGauss | ( | double | sigma2, |
| maths::Vector< double > | focuspos, | ||
| maths::Vector< std::complex< double > > | Pol ) |
Initialises the ray for a gaussian beam according to
\( \vec E=\vec{Pol} \cdot e^{-ik_0h} \cdot e^{-(r^2-h^2)/\sigma_2} \) where \( r=(\vec{F}-\vec{P})\cdot\vec{k},~h=r-|\vec{F}-\vec{P}| \) ( \(\vec{F}\): focal point)
E1 and E2 are set to the same value !
| void GOAT::raytracing::IRay::initElectricFieldGauss | ( | maths::Vector< std::complex< double > > & | Pol, |
| Gauss | g ) |
Initialises the ray for gaussian beam with help of the plane Eb and the polarisation vector Pol (second polarisation is not used, E2 is set to E1). The parameters for the gaussian beam are stored in g.
| maths::Vector< double > GOAT::raytracing::IRay::intersectRect | ( | const maths::Vector< double > | P, |
| const maths::Vector< double > | e1, | ||
| const maths::Vector< double > | e2 ) |
Calculates the intersection point between the ray and a rectangle defined by the edge point P and the vectors e1 and e2. If there is no intersection point, a NaN valued vector is returned.
|
inlinevirtual |
Returns true if ray is inside an object.
Implements GOAT::raytracing::RayBase.
|
virtual |
make the next step (has to include phase progress)
Implements GOAT::raytracing::RayBase.
|
inlinevirtual |
Returns the index of the last hidden object (or -1 if no object was hidden)
Implements GOAT::raytracing::RayBase.
|
inline |
|
inline |
| IRay GOAT::raytracing::IRay::reflect | ( | maths::Vector< double > | n, |
| std::complex< double > | n1, | ||
| std::complex< double > | n2 ) |
This function reflects ray on the surface. Here, the ray is reflected and the transmitted ray is created.
| n | Surface normal |
| n1 | Refractive index (incident side) |
| n2 | Refractive index (transmitted side) |
|
inline |
|
virtual |
Reflects ray on the surface /param tray Transmitted (=refracted) ray /param n Surface normal /param n1 Refractive index (incident side) /param n2 Refractive index (transmitted side)
Implements GOAT::raytracing::RayBase.
Reimplemented in GOAT::raytracing::Ray_pow.
| void GOAT::raytracing::IRay::refract | ( | maths::Vector< double > | N, |
| std::complex< double > | n1, | ||
| std::complex< double > | n2 ) |
This function refracts the ray on the surface.
| N | Surface normal |
| n1 | Refractive index (incident side) |
| n2 | Refractive index (transmitted side) |
|
inline |
|
inline |
|
inline |
|
inline |
|
friend |
| maths::Vector<std::complex<double> > GOAT::raytracing::IRay::E1 |
| maths::Vector<std::complex<double> > GOAT::raytracing::IRay::E2 |
| maths::Vector<double> GOAT::raytracing::IRay::k |
|
protected |
| maths::Vector<double> GOAT::raytracing::IRay::P |