49 std::complex<double>
n,
87 double a() {
return r[0]; }
88 double b() {
return r[1]; }
89 double c() {
return r[2]; }
98 void seta(
double a,
bool VConst =
false);
102 void setb(
double b,
bool VConst =
false);
106 void setc(
double c,
bool VConst =
false);
This class represents a threedimensional (numeric) Matrix as a template.
Template class for threedimensional vectors.
double volume()
Calculates the volume of the ellipsoid.
void setr(double a, double b, double c)
Sets the lengths of the three half axis, represented by a, b and c.
maths::Vector< double > norm(const maths::Vector< double > &p)
calculates the surface normal of the ellipsoid at a certain point (p must be on the surface)
maths::Vector< double > P2
Square of the position vector P: P2=(P[0]^2,P[1]^2,P[2]^2) (for internal use only)
Ellipsoid(const maths::Vector< double > &P, const maths::Vector< double > &r, 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)
Main constructor for class Ellipsoid.
void setPos(double x, double y, double z)
Sets the position of the ellipsoid(center) to a vector, represented by its components x,...
maths::Matrix< double > computeInertia()
Calculates the inertia matrix of the ellipsoid.
bool isInside(const maths::Vector< double > &p)
Checks if a certain position is inside the object.
maths::Vector< double > getr()
Returns a vector, where its components are the lengths of the three half axis.
maths::Vector< double > calcCoM()
Calculates the center of mass, which is in the case of an ellipsoid simply its center,...
void binRead(std::ifstream &os)
Reads informatopn about an ellipsoid from a binary file.
void initQuad()
Sets the circumscribing cuboid (for use in inelastic calculations)
double c()
Returns the length of the third half axis.
maths::Vector< double > r
GOAT::maths::Vector, where its components represent the lengths of the corresponding half axis.
double b()
Returns the length of the second half axis.
void setr(maths::Vector< double > &r)
Sets the lengths of the three half axis, represented by the components of r.
Ellipsoid & operator=(Ellipsoid &f)
void setPos(maths::Vector< double > r)
Set the position of the ellipsoid (center) to r.
Ellipsoid(const ObjectShape &)
void setr0(double r0)
defines the radius of the calculation sphere
void seta(double a, bool VConst=false)
void setb(double b, bool VConst=false)
bool next(const maths::Vector< double > &Ps, const maths::Vector< double > &K, maths::Vector< double > &pout)
Calculates the next intersection point with a ray, which is represented by a reference point and the ...
void scale(double sf)
Set the scaling factor (the half axis will be multiplied by this factor)
void binWrite(std::ofstream &os)
Writes information about the ellipsoid in a binary file.
double a()
Returns the length of the first half axis.
friend std::ostream & operator<<(std::ostream &os, Ellipsoid E)
Ellipsoid(const Ellipsoid &E)
Copy Constructor.
maths::Vector< double > r_2
GOAT::maths::Vector, where its components represent the square of lengths of the corresponding half a...
void setc(double c, bool VConst=false)
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
This file contains the definition of a template for 3x3 matrices, which can be used together with the...
const Matrix< std::complex< double > > CUNITY
Unity matrix (complex-valued)
Raytracer used for ultrashort pulse calculation with raytracing only.
This class is used for the iray class. This class is intended for internal use only....
This file contains the Vector template class and some useful functions around this class.