ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/group/branches/new_design/OOPSE-4/src/primitives/Bend.cpp
(Generate patch)

Comparing branches/new_design/OOPSE-4/src/primitives/Bend.cpp (file contents):
Revision 1781 by tim, Thu Nov 18 05:42:06 2004 UTC vs.
Revision 1782 by tim, Wed Nov 24 20:55:03 2004 UTC

# Line 11 | Line 11 | void Bend::calcForce() {
11      Vector3d r12 = pos1 - pos2;
12      double d12 = r12.length();
13  
14 <    double d12inv = 1. 0 / d12;
14 >    double d12inv = 1.0 / d12;
15  
16      Vector3d r32 = pos3 - pos2;
17      double d32 = r32.length();
18  
19 <    double d32inv = 1. 0 / d32;
19 >    double d32inv = 1.0 / d32;
20  
21 <    double cosTheta = (r12 * r32) / (d12 * d32);
21 >    double cosTheta = dot(r12, r32) / (d12 * d32);
22  
23      //check roundoff    
24      if (cosTheta > 1.0) {
# Line 35 | Line 35 | void Bend::calcForce() {
35  
36      double sinTheta = sqrt(1.0 - cosTheta * cosTheta);
37  
38 <    if (fabs(sinTheta) < 1.0E -12) {
39 <        sinTheta = 1.0E -12;
38 >    if (fabs(sinTheta) < 1.0E-12) {
39 >        sinTheta = 1.0E-12;
40      }
41  
42      double commonFactor1 = -firstDerivative / sinTheta * d12inv;

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines