63 RealType st = sin(theta);
64 RealType ct = cos(theta);
65 c2_ = 1.0 / (4.0 * st * st);
66 c1_ = -4.0 * c2_ * ct;
67 c0_ = c2_ * (2.0 * ct * ct + 1.0);
70 void setForceConstant(RealType k) { k_ = k; }
72 RealType getForceConstant() {
return k_; }
74 void calcForce(RealType theta, RealType& V, RealType& dVdtheta) {
75 RealType ct = cos(theta);
76 RealType st = sin(theta);
79 V = k_ * (c0_ + c1_ * ct + c2_ * (2.0 * ct * ct - 1.0));
80 dVdtheta = -k_ * (c1_ * st + 2.0 * c2_ * sin(2.0 * theta));