22 namespace kinematic_closure {
27 return a[1]*b[1] + a[2]*b[2] + a[3]*b[3];
33 result[1] = a[2]*b[3] - a[3]*b[2];
34 result[2] = a[3]*b[1] - a[1]*b[3];
35 result[3] = a[1]*b[2] - a[2]*b[1];
43 Real magnitude = sqrt(
44 a[1]*a[1] + a[2]*a[2] + a[3]*a[3]);
46 result[1] = a[1] / magnitude;
47 result[2] = a[2] / magnitude;
48 result[3] = a[3] / magnitude;
57 for (
Size i = 1; i <= x.size(); i++ ) {
58 std::string prefix = (i == 1) ?
"[" :
" ";
59 std::string suffix = (i == x.size()) ?
"]" :
",";
61 out << prefix << x[i] << suffix;
67 for (
Size i = 1; i <= xx.size(); i++ ) {
68 std::string prefix = (i == 1) ?
"[" :
" ";
69 std::string suffix = (i == xx.size()) ?
"]" :
",";
71 out << prefix << xx[i] << suffix << std::endl;
79 result[1] = a[1] + b[1];
80 result[2] = a[2] + b[2];
81 result[3] = a[3] + b[3];
89 result[1] = a[1] - b[1];
90 result[2] = a[2] - b[2];
91 result[3] = a[3] - b[3];
100 result[2] = a[2] * k;
101 result[3] = a[3] * k;
109 result[1] = k * a[1];
110 result[2] = k * a[2];
111 result[3] = k * a[3];
119 result[1] = a[1] / k;
120 result[2] = a[2] / k;
121 result[3] = a[3] / k;
129 result[1] = k / a[1];
130 result[2] = k / a[2];
131 result[3] = k / a[3];
Coordinate operator/(Coordinate const &a, Real const &k)
Coordinate norm(Coordinate const &a)
Coordinate operator+(Coordinate const &a, Coordinate const &b)
Implement the primitive vector operations (again).
Coordinate operator*(Coordinate const &a, Real const &k)
std::ostream & operator<<(std::ostream &out, ParameterList const &x)
Real dot(Coordinate const &a, Coordinate const &b)
std::vector with 1-based indexing
rosetta project type declarations. Should be kept updated with core/types.hh. This exists because num...
void cross(const utility::vector1< Real > &L, const utility::vector1< Real > &r0, utility::vector1< Real > &r)
Coordinate operator-(Coordinate const &a, Coordinate const &b)