Don't like ads? PRO users don't see any ads ;-)
Guest

alex

By: a guest on Mar 5th, 2009  |  syntax: C++  |  size: 0.48 KB  |  hits: 108  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. void vtest(void) {
  2.        
  3.         Double_t theta;
  4.         Double_t phi;
  5.        
  6.         TVector3 v(1,2,3);
  7.                
  8.         theta = v.Theta();
  9.         phi   = v.Phi();       
  10.         cout << "theta = " << theta << ", phi = " << phi << "\n";
  11.        
  12.         v.SetTheta(-0.1);
  13.  
  14.         theta = v.Theta();
  15.         phi   = v.Phi();       
  16.         cout << "theta = " << theta << ", phi = " << phi << "  <- Why is theta positive?\n";
  17.  
  18.         v.SetPhi(-0.1);
  19.  
  20.         theta = v.Theta();
  21.         phi   = v.Phi();       
  22.         cout << "theta = " << theta << ", phi = " << phi << "  <- Setting phi seems to work\n";
  23.        
  24. }