GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
cone.h
Go to the documentation of this file.
1#pragma once
2#include "objectshape.h"
3
4namespace GOAT
5{
6 namespace raytracing
7 {
15 class Cone : public ObjectShape
16 {
17 public:
28 double radius,
29 double height,
30 std::complex<double> n,
31 double r0 = 1.0,
32 const maths::Matrix<std::complex<double> > alpha = maths::CUNITY,
33 const maths::Vector<double>& Ex = maths::ex,
34 const maths::Vector<double>& Ey = maths::ey,
35 const maths::Vector<double>& Ez = maths::ez
36 );
38
39 void binWrite(std::ofstream& os);
40 void binRead(std::ifstream& os);
41 void scale(double sf);
51
63
65 double volume();
66 void initQuad();
68 void setPos(double x, double y, double z);
69 void setr0(double r0);
71 void setConeAngle (double coneAngle);
72 double getConeAngle ();
73 void setRadius(double radius);
74 double getRadius();
75 void setHeight(double height);
76 double getHeight();
77
78 private:
82 double coneAngle;
83 double cosCA;
84 double tan2CA;
85 double sideLen;
86 double radius;
87 double height;
88
89 void init();
90 };
91
92
93 }
94}
This class represents a threedimensional (numeric) Matrix as a template.
Definition matrix.h:23
Template class for threedimensional vectors.
Definition vector.h:57
maths::Vector< double > v
Vector from the tip cone to the reference point Pos.
Definition cone.h:80
void setPos(maths::Vector< double > r)
sets reference point P
void setr0(double r0)
defines the radius of the calculation sphere
double getHeight()
Returns the height of the cone.
double radius
radius of the base area
Definition cone.h:86
double tan2CA
square of the tangens of the cone angle
Definition cone.h:84
double nextCone(const maths::Vector< double > &p, const maths::Vector< double > &k, maths::Vector< double > &pout)
Calculates the next crossing point with the lateral surface of the cone. The method calculates the ne...
double getConeAngle()
Returns the cone angle.
double cosCA
cosine of the cone angle
Definition cone.h:83
void setRadius(double radius)
Set the radius of the cone.
void scale(double sf)
maths::Vector< double > norm(const maths::Vector< double > &P)
surface normal at the point P
void setConeAngle(double coneAngle)
Set the cone angle.
void init()
Initialisation of all internal variables.
maths::Vector< double > calcCoM()
calculates center of mass (needed by setCenter2CoM () )
void binWrite(std::ofstream &os)
binary writing to file
void setPos(double x, double y, double z)
sets reference point P
double getRadius()
Returns the radius of the cone.
maths::Vector< double > V
Position of the tip of the cone.
Definition cone.h:79
Cone(maths::Vector< double > Pos, double radius, double height, std::complex< double > n, double r0=1.0, const maths::Matrix< std::complex< double > > alpha=maths::CUNITY, const maths::Vector< double > &Ex=maths::ex, const maths::Vector< double > &Ey=maths::ey, const maths::Vector< double > &Ez=maths::ez)
Constructor which defines the cone by the reference point, radius and height.
double volume()
returns the volume of the object
bool next(const maths::Vector< double > &p, const maths::Vector< double > &k, maths::Vector< double > &pout)
Calculates next crossing point with ray. This method calculates the next crossing point with the enti...
void initQuad()
calculates the circumferent cuboid (needed e.g. for the inelastic scattering calculations)
void binRead(std::ifstream &os)
binary reading from file
maths::Vector< double > normv
normalized Vector from the tip cone to the reference point Pos
Definition cone.h:81
double sideLen
length of the side of the cone
Definition cone.h:85
bool isInside(const maths::Vector< double > &p)
checks if point P is inside the object
double height
height of the cone
Definition cone.h:87
double coneAngle
cone angle
Definition cone.h:82
void setHeight(double height)
Set the height of the cone.
double sf
scaling factor, it is used to scale the shape of the object
maths::Matrix< std::complex< double > > alpha
polarisability matrix
maths::Vector< double > P
position of the object
double r0
radius of the calculation sphere
std::complex< double > n
refractive index of the object
const Matrix< std::complex< double > > CUNITY
Unity matrix (complex-valued)
Definition matrix.h:475
Raytracer used for ultrashort pulse calculation with raytracing only.
Definition asphericLens.h:6
This class is used for the iray class. This class is intended for internal use only....
Definition fresnel.h:7