EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | Public Attributes | Friends | List of all members
EGS_Vector Class Reference

A class representing 3D vectors. More...

#include <egs_vector.h>

Public Member Functions

 EGS_Vector (EGS_Float xx, EGS_Float yy, EGS_Float zz)
 
 EGS_Vector (const EGS_Vector &v)
 
EGS_Vectoroperator= (const EGS_Vector &v)
 
EGS_Vector operator+ (const EGS_Vector &v) const
 
EGS_Vectoroperator+= (const EGS_Vector &v)
 
EGS_Vector operator- (const EGS_Vector &v) const
 
EGS_Vectoroperator-= (const EGS_Vector &v)
 
EGS_Vector operator* (const EGS_Float f) const
 
EGS_Vectoroperator*= (const EGS_Float f)
 
EGS_Float operator* (const EGS_Vector &v) const
 
EGS_Vector times (const EGS_Vector &v) const
 
EGS_Vector operator% (const EGS_Vector &v) const
 
EGS_Vector getScaled (const EGS_Vector &s) const
 
void scale (const EGS_Vector &s)
 
EGS_Float length () const
 
EGS_Float length2 () const
 
void normalize ()
 
void rotate (EGS_Float cos_t, EGS_Float sin_t, EGS_Float c_phi, EGS_Float s_phi)
 

Public Attributes

EGS_Float x
 x-component
 
EGS_Float y
 y-component
 
EGS_Float z
 z-component
 

Friends

EGS_Vector operator* (EGS_Float f, const EGS_Vector &v)
 

Detailed Description

A class representing 3D vectors.

The EGS_Vector class is used throughout egspp for representing 3D vectors in cartesian co-ordinates (e.g. particle positions and directions). It provides various convenience methods for vector additions, subtractions, multiplications, etc.

Examples:
geometry/egs_box/egs_box.cpp, sources/egs_point_source/egs_point_source.cpp, and tutor7pp.cpp.

Definition at line 56 of file egs_vector.h.


The documentation for this class was generated from the following file: