GOAT (Geometrical optics application tool) 0.1
Loading...
Searching...
No Matches
cylinder.h
Go to the documentation of this file.
1#pragma once
2#include "objectshape.h"
3namespace GOAT
4{
5 namespace raytracing
6 {
12 class Cylinder :
13 public ObjectShape
14 {
15 public:
21 double r,
22 double h,
23 std::complex<double> n,
24 double r0 = 1.0,
25 const maths::Matrix<std::complex<double> > alpha = maths::CUNITY,
26 const maths::Vector<double>& Ex = maths::ex,
27 const maths::Vector<double>& Ey = maths::ey,
28 const maths::Vector<double>& Ez = maths::ez
29 );
30 double radius() { return r; }
31 double height() { return h; }
32 void setRadius(double r);
33 void setHeight(double h);
34 void setr0(double r0);
35 void binWrite(std::ofstream& os);
36 void binRead(std::ifstream& is);
39 double volume();
40 void initQuad();
44 void setPos(double x, double y, double z) { P = maths::Vector<double>(x, y, z); };
49 void scale(double sf);
50 protected :
51 double h = 1.0;
52 double r = 1.0;
53
54 };
55 }
56}
This class represents a threedimensional (numeric) Matrix as a template.
Definition matrix.h:23
Template class for threedimensional vectors.
Definition vector.h:57
bool next(const maths::Vector< double > &Ps, const maths::Vector< double > &K, maths::Vector< double > &pout)
searches for the next (nearest) intersection of a ray with the object, p: current position of the ray...
Cylinder(ObjectShape &os)
Cylinder(const maths::Vector< double > &P, double r, double h, 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)
maths::Vector< double > calcCoM()
Calculates the center of mass, which is in the case of an ellipsoid simply its center,...
Definition cylinder.h:41
maths::Vector< double > norm(const maths::Vector< double > &p)
surface normal at the point P
void scale(double sf)
Set the scaling factor (the half axis will be multiplied by this factor)
void binRead(std::ifstream &is)
binary reading from file
maths::Matrix< double > computeInertia()
Calculates the inertia matrix of the ellipsoid.
Cylinder & operator=(Cylinder &f)
void setr0(double r0)
defines the radius of the calculation sphere
void binWrite(std::ofstream &os)
binary writing to file
void setPos(maths::Vector< double > r)
sets reference point P
Definition cylinder.h:43
double volume()
Calculates the volume of the ellipsoid.
void initQuad()
Sets the circumscribing cuboid (for use in inelastic calculations)
void setPos(double x, double y, double z)
sets reference point P
Definition cylinder.h:44
void setHeight(double h)
set the height of the cylinder
bool isInside(const maths::Vector< double > &p)
checks if point P is inside the object
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