-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcylinderAbsorber.cpp
60 lines (47 loc) · 1.48 KB
/
cylinderAbsorber.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
//
// CylinderAbsorber.cpp
// Xcode
//
// Created by jacob on 6/20/11.
//
#include "absorber.h"
#include "cylinderAbsorber.h"
// Cylinder constructor takes the radius and the top and bottom coordinates
// of the cylinder.
CylinderAbsorber::CylinderAbsorber(const double radius, const boost::shared_ptr<Vector3d> top,
const boost::shared_ptr<Vector3d> bottom)
:Absorber(center)
{
// Calculate the length of the cylinder.
this->length = sqrt(pow(top->location.x - bottom->location.x, 2) +
pow(top->location.y - bottom->location.y, 2) +
pow(top->location.z - bottom->location.z, 2));
this->radius = radius;
this->topCenter = (*top);
this->bottomCenter = (*bottom);
}
CylinderAbsorber::~CylinderAbsorber()
{
// STUB
}
bool CylinderAbsorber::crossedAbsorber(const boost::shared_ptr<Vector3d> photonVector)
{
// STUB
}
bool CylinderAbsorber::hitAbsorberBoundary(const boost::shared_ptr<Vector3d> photonVector)
{
// STUB
}
// Need to draw a line from top and bottom disc of the cylinder.
// If the length of the line from the photon to that line is
// larger than the cylinder's radius, then return false. Else
// return true.
// Also need to check if the photon had passed through the cylinder.
bool CylinderAbsorber::inAbsorber(const boost::shared_ptr<Vector3d> photonVector)
{
//
}
void CylinderAbsorber::cartesianToCylindrical(void)
{
// STUB
}