54 |
Cylinder::Cylinder(const Vertex& a, const Vertex& b, const real_t& r) |
Cylinder::Cylinder(const Vertex& a, const Vertex& b, const real_t& r) |
55 |
: Shape(cylinder), |
: Shape(cylinder), |
56 |
__c1(a), __c2(b), |
__c1(a), __c2(b), |
57 |
__center(Vertex((a.X()+b.X())/2, (a.Y()+b.Y())/2, (a.Z()+b.Z())/2)), |
__center(Vertex((a.x()+b.x())/2, (a.y()+b.y())/2, (a.z()+b.z())/2)), |
58 |
__radius (r), |
__radius (r), |
59 |
__radius2(r*r), |
__radius2(r*r), |
60 |
__half_height(__center.distance(__c1)), |
__half_height(__center.distance(__c1)), |
61 |
__u((b.X()-a.X())/(2*__half_height), |
__u((b.x()-a.x())/(2*__half_height), |
62 |
(b.Y()-a.Y())/(2*__half_height), |
(b.y()-a.y())/(2*__half_height), |
63 |
(b.Z()-a.Z())/(2*__half_height)) |
(b.z()-a.z())/(2*__half_height)) |
64 |
{ |
{ |
65 |
; |
; |
66 |
} |
} |