ROOT
git-r3/HEAD
Reference Guide
Loading...
Searching...
No Matches
TPARA.cxx
Go to the documentation of this file.
1
// @(#)root/g3d:$Id$
2
// Author: Nenad Buncic 19/09/95
3
4
/*************************************************************************
5
* Copyright (C) 1995-2000, Rene Brun and Fons Rademakers. *
6
* All rights reserved. *
7
* *
8
* For the licensing terms see $ROOTSYS/LICENSE. *
9
* For the list of contributors see $ROOTSYS/README/CREDITS. *
10
*************************************************************************/
11
12
#include "
TPARA.h
"
13
#include "
TNode.h
"
14
#include "
TMath.h
"
15
16
17
/** \class TPARA
18
\ingroup g3d
19
A parallelepiped.
20
21
\image html g3d_para.png
22
It has 9 parameters:
23
24
- name: name of the shape
25
- title: shape's title
26
- material: (see TMaterial)
27
- dx: half-length in x
28
- dy: half-length in y
29
- dz: half-length in z
30
- alpha: angle formed by the y axis and by the plane joining the
31
centre of the faces parallel to the z-x plane at -DY and +DY
32
- theta: polar angle of the line joining the centres of the faces
33
at -DZ and +DZ in z
34
- phi: azimuthal angle of the line joining the centres of the
35
faces at -DZ and +DZ in z
36
*/
37
38
////////////////////////////////////////////////////////////////////////////////
39
/// PARA shape default constructor
40
41
TPARA::TPARA
()
42
{
43
fAlpha
= 0.;
44
fTheta
= 0.;
45
fPhi
= 0.;
46
}
47
48
////////////////////////////////////////////////////////////////////////////////
49
/// PARA shape normal constructor
50
51
TPARA::TPARA
(
const
char
*
name
,
const
char
*title,
const
char
*material,
Float_t
dx,
Float_t
dy,
Float_t
dz,
52
Float_t
alpha,
Float_t
theta,
Float_t
phi) :
TBRIK
(
name
, title,material, dx, dy, dz)
53
{
54
fAlpha
= alpha;
55
fTheta
= theta;
56
fPhi
= phi;
57
}
58
59
////////////////////////////////////////////////////////////////////////////////
60
/// PARA shape default destructor
61
62
TPARA::~TPARA
()
63
{
64
}
65
66
////////////////////////////////////////////////////////////////////////////////
67
/// Create PARA points
68
69
void
TPARA::SetPoints
(
Double_t
*
points
)
const
70
{
71
if
(!
points
)
return
;
72
Float_t
dx, dy, dz, theta, phi, alpha;
73
const
Float_t
pi =
Float_t
(
TMath::Pi
());
74
75
alpha =
fAlpha
* pi/180.0;
76
theta =
fTheta
* pi/180.0;
77
phi =
fPhi
* pi/180.0;
78
79
dx =
TBRIK::fDx
;
80
dy =
TBRIK::fDy
;
81
dz =
TBRIK::fDz
;
82
83
// Parallelepiped change angles to tangents (by Pavel Nevski 12/04/99)
84
Double_t
txy =
TMath::Tan
(alpha);
85
Double_t
tth =
TMath::Tan
(theta);
86
Double_t
txz = tth*
TMath::Cos
(phi);
87
Double_t
tyz = tth*
TMath::Sin
(phi);
88
89
*
points
++ = -dz*txz-txy*dy-dx ; *
points
++ = -dy-dz*tyz ; *
points
++ = -dz;
90
*
points
++ = -dz*txz+txy*dy-dx ; *
points
++ = +dy-dz*tyz ; *
points
++ = -dz;
//3
91
*
points
++ = -dz*txz+txy*dy+dx ; *
points
++ = +dy-dz*tyz ; *
points
++ = -dz;
92
*
points
++ = -dz*txz-txy*dy+dx ; *
points
++ = -dy-dz*tyz ; *
points
++ = -dz;
//1
93
*
points
++ = +dz*txz-txy*dy-dx ; *
points
++ = -dy+dz*tyz ; *
points
++ = +dz;
94
*
points
++ = +dz*txz+txy*dy-dx ; *
points
++ = +dy+dz*tyz ; *
points
++ = +dz;
//7
95
*
points
++ = +dz*txz+txy*dy+dx ; *
points
++ = +dy+dz*tyz ; *
points
++ = +dz;
96
*
points
++ = +dz*txz-txy*dy+dx ; *
points
++ = -dy+dz*tyz ; *
points
++ = +dz;
//5
97
}
Double_t
double Double_t
Double 8 bytes.
Definition
RtypesCore.h:73
Float_t
float Float_t
Float 4 bytes (float).
Definition
RtypesCore.h:71
name
char name[80]
Definition
TGX11.cxx:148
TMath.h
TNode.h
TPARA.h
points
point * points
Definition
X3DBuffer.c:22
TBRIK::fDz
Float_t fDz
Definition
TBRIK.h:31
TBRIK::fDy
Float_t fDy
Definition
TBRIK.h:30
TBRIK::fDx
Float_t fDx
Definition
TBRIK.h:29
TBRIK::TBRIK
TBRIK()
BRIK shape default constructor.
Definition
TBRIK.cxx:37
TPARA::fAlpha
Float_t fAlpha
Definition
TPARA.h:32
TPARA::fTheta
Float_t fTheta
Definition
TPARA.h:33
TPARA::~TPARA
~TPARA() override
PARA shape default destructor.
Definition
TPARA.cxx:62
TPARA::SetPoints
void SetPoints(Double_t *points) const override
Create PARA points.
Definition
TPARA.cxx:69
TPARA::TPARA
TPARA()
PARA shape default constructor.
Definition
TPARA.cxx:41
TPARA::fPhi
Float_t fPhi
Definition
TPARA.h:34
TMath::Cos
Double_t Cos(Double_t)
Returns the cosine of an angle of x radians.
Definition
TMath.h:605
TMath::Pi
constexpr Double_t Pi()
Definition
TMath.h:40
TMath::Sin
Double_t Sin(Double_t)
Returns the sine of an angle of x radians.
Definition
TMath.h:599
TMath::Tan
Double_t Tan(Double_t)
Returns the tangent of an angle of x radians.
Definition
TMath.h:611
graf3d
g3d
src
TPARA.cxx
ROOTgit-r3/HEAD - Reference Guide Generated on
(GVA Time) using Doxygen 1.16.1