19 double Point::z()
const {
return m_z;}
25 Point& Point::operator*=(
double scalar) {
34 double Point::mag()
const {
35 return std::sqrt(
mag2());
38 double Point::operator[](
unsigned int i)
const {
42 std::ostringstream ost;
43 ost<<
"TranversePoint index out of range: "<<i<<
'\n';
44 throw std::range_error(ost.str());
47 if(i == 0){
return m_x;}
48 if(i == 1){
return m_y;}
52 double& Point::operator[](
unsigned int i){
56 std::ostringstream ost;
57 ost<<
"TranversePoint index out of range: "<<i<<
'\n';
58 throw std::range_error(ost.str());
61 if(i == 0){
return m_x;}
62 if(i == 1){
return m_y;}
92 std::string Point::str()
const{
93 std::ostringstream ost;
94 ost<<std::setprecision(3)<<std::scientific<<
"x\t"<<
m_x<<
" y\t"<<
m_y<<
" z\t"<<
m_z;
Point operator-(const Point &lhs, const Point &rhs)
Point operator+(const Point &lhs, const Point &rhs)
Point operator*(double, const Point &lhs)
std::ostream & operator<<(std::ostream &os, const Beamline &bl)
Point(double x_, double y_, double slope_)
Single point and slope to next point.