@@ -113,8 +113,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
113113 // a'+---------a
114114 // r
115115
116- V3d vab = new V3d ();
117- vab .sub2 (b , a );
116+ V3d vab = V3d .newVsub (b , a );
118117 /*
119118 * testing here to see if directing the normal makes any difference -- oddly
120119 * enough, it does not. When n = -n and theta = -theta vab.n is reversed,
@@ -125,7 +124,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
125124 double theta = dq .getTheta ();
126125 V3d n = dq .getNormal ();
127126 double v_dot_n = vab .dot (n );
128- if (Math .abs (v_dot_n ) < 0.0001f )
127+ if (Math .abs (v_dot_n ) < 0.0001 )
129128 v_dot_n = 0 ;
130129 V3d va_prime_d = new V3d ();
131130 va_prime_d .cross (vab , n );
@@ -137,7 +136,7 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
137136 v_dot_n = 2E-45 ; // allow for perpendicular axis to vab
138137 vcb .scale (v_dot_n );
139138 vda .sub2 (vcb , vab );
140- vda .scale (0.5f );
139+ vda .scale (0.5d );
141140 va_prime_d .scale (theta == 0 ? 0 : (vda .length () / Math .tan (theta
142141 / 2 / 180 * Math .PI )));
143142 V3d r = V3d .newV (va_prime_d );
@@ -152,12 +151,12 @@ public static T3d[] computeHelicalAxis(P3d a, P3d b, Qd dq) {
152151 P3d pt_b_prime = P3d .newP (pt_a_prime );
153152 pt_b_prime .add (n );
154153 theta = computeTorsion (a , pt_a_prime , pt_b_prime , b , true );
155- if (Double .isNaN (theta ) || r .length () < 0.0001f )
154+ if (Double .isNaN (theta ) || r .length () < 0.0001 )
156155 theta = dq .getThetaDirectedV (n ); // allow for r = 0
157156 // anything else is an array
158157 double residuesPerTurn = Math .abs (theta == 0 ? 0 : 360f / theta );
159158 double pitch = Math .abs (v_dot_n == 2E-45 ? 0 : n .length ()
160- * (theta == 0 ? 1 : 360f / theta ));
159+ * (theta == 0 ? 1 : 360.0 / theta ));
161160 return new T3d [] { pt_a_prime , n , r , P3d .new3 (theta , pitch , residuesPerTurn ), pt_b_prime };
162161 }
163162
@@ -1005,7 +1004,7 @@ public static Lst<P3d> getLatticePoints(Lst<P3d> cpts, int h, int k, int l) {
10051004 }
10061005 }
10071006 for (int i = n ; --i >= 0 ;)
1008- cpts .removeItemAt (i );
1007+ cpts .removeItemAt (0 );
10091008 return cpts ;
10101009 }
10111010
0 commit comments