Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Data Structures | Functions
UVector2.hh File Reference
#include <cmath>
#include <iostream>
#include "UVector3.hh"

Go to the source code of this file.

Data Structures

class  UVector2
 

Functions

std::ostream & operator<< (std::ostream &, const UVector2 &)
 
double operator* (const UVector2 &a, const UVector2 &b)
 
UVector2 operator* (const UVector2 &p, double a)
 
UVector2 operator* (double a, const UVector2 &p)
 
UVector2 operator/ (const UVector2 &p, double a)
 
UVector2 operator+ (const UVector2 &a, const UVector2 &b)
 
UVector2 operator- (const UVector2 &a, const UVector2 &b)
 

Function Documentation

double operator* ( const UVector2 a,
const UVector2 b 
)
inline

Definition at line 396 of file UVector2.hh.

References UVector2::dot().

397 {
398  return a.dot(b);
399 }
double dot(const UVector2 &p) const
Definition: UVector2.hh:300
UVector2 operator* ( const UVector2 p,
double  a 
)
inline

Definition at line 386 of file UVector2.hh.

References UVector2::x, and UVector2::y.

387 {
388  return UVector2(a * p.x, a * p.y);
389 }
double x
Definition: UVector2.hh:195
double y
Definition: UVector2.hh:196
UVector2 operator* ( double  a,
const UVector2 p 
)
inline

Definition at line 391 of file UVector2.hh.

References UVector2::x, and UVector2::y.

392 {
393  return UVector2(a * p.x, a * p.y);
394 }
double x
Definition: UVector2.hh:195
double y
Definition: UVector2.hh:196
UVector2 operator+ ( const UVector2 a,
const UVector2 b 
)
inline

Definition at line 376 of file UVector2.hh.

References UVector2::x, and UVector2::y.

377 {
378  return UVector2(a.x + b.x, a.y + b.y);
379 }
double x
Definition: UVector2.hh:195
double y
Definition: UVector2.hh:196
UVector2 operator- ( const UVector2 a,
const UVector2 b 
)
inline

Definition at line 381 of file UVector2.hh.

References UVector2::x, and UVector2::y.

382 {
383  return UVector2(a.x - b.x, a.y - b.y);
384 }
double x
Definition: UVector2.hh:195
double y
Definition: UVector2.hh:196
UVector2 operator/ ( const UVector2 p,
double  a 
)

Definition at line 73 of file UVector2.cc.

References UVector2::x, and UVector2::y.

74 {
75  if (a == 0)
76  {
77  // ZMthrowA(ZMxpvInfiniteVector( "Division of UVector2 by zero"));
78  }
79  return UVector2(p.x / a, p.y / a);
80 }
double x
Definition: UVector2.hh:195
double y
Definition: UVector2.hh:196
std::ostream& operator<< ( std::ostream &  ,
const UVector2  
)

Definition at line 82 of file UVector2.cc.

References UVector2::x, and UVector2::y.

83 {
84  os << "(" << q.x << ", " << q.y << ")";
85  return os;
86 }