BmnRoot 26.10.0-18-g4e3414f9
Software framework of the BM@N experiment
Loading...
Searching...
No Matches
rotateAxis.C
Go to the documentation of this file.
1/*
2 * To change this license header, choose License Headers in Project Properties.
3 * To change this template file, choose Tools | Templates
4 * and open the template in the editor.
5 */
6
7/*
8 * File: rotateAxis.C
9 * Author: mikhailr
10 *
11 * Created on May 22, 2018, 4:52 PM
12 */
13
14#include <TMath.h>
15#include <cstdlib>
16
17using namespace std;
18
19void rotateAxis(Double_t X = 0, Double_t Y = 0, Double_t Z = 0, Double_t angle = 0)
20{
21
22 // gROOT->LoadMacro("$VMCWORKDIR/macro/run/bmnloadlibs.C");
23 // bmnloadlibs(); // load libraries
24
25 Double_t XX, YY, ZZ, AngleRad;
26 AngleRad = angle * TMath::DegToRad();
27 // z- beam, y - vertical
28 // Rotate around Y
29 XX = X * TMath::Cos(AngleRad) - Z * TMath::Sin(AngleRad);
30 YY = Y;
31 ZZ = X * TMath::Sin(AngleRad) + Z * TMath::Cos(AngleRad);
32 cout << "New X = " << XX << "; New Y = " << YY << "; New Z = " << ZZ << endl;
33}
double Double_t
void rotateAxis(Double_t X=0, Double_t Y=0, Double_t Z=0, Double_t angle=0)
Definition rotateAxis.C:19
constexpr Double_t DegToRad()
Double_t Cos(Double_t)
Double_t Sin(Double_t)
Definition json.hpp:4446