~corrado-maurini/dolfin/tao

« back to all changes in this revision

Viewing changes to dolfin/mesh/Point.cpp

  • Committer: corrado maurini
  • Date: 2012-12-18 12:16:08 UTC
  • mfrom: (6685.78.207 trunk)
  • Revision ID: corrado.maurini@upmc.fr-20121218121608-nk82ly9jgsld9u84
updating with trunk, fix uint in TAO solver and hacking the check for tao FindTAO.cmake

Show diffs side-by-side

added added

removed removed

Lines of Context:
22
22
 
23
23
#include <cmath>
24
24
#include "Point.h"
 
25
#include <dolfin/common/constants.h>
 
26
#include <dolfin/log/log.h>
 
27
#include <dolfin/log/LogStream.h>
 
28
#include <dolfin/math/basic.h>
25
29
 
26
30
using namespace dolfin;
27
31
 
56
60
  return _x[0]*p._x[0] + _x[1]*p._x[1] + _x[2]*p._x[2];
57
61
}
58
62
//-----------------------------------------------------------------------------
 
63
Point Point::rotate(const Point& k, double theta) const
 
64
{
 
65
  dolfin_assert(near(k.norm(), 1.0));
 
66
 
 
67
  const Point& v = *this;
 
68
  const double cosTheta = cos(theta);
 
69
  const double sinTheta = sin(theta);
 
70
 
 
71
  //Rodriques' rotation formula
 
72
  return v*cosTheta + k.cross(v)*sinTheta + k*k.dot(v)*(1-cosTheta);
 
73
}
 
74
//-----------------------------------------------------------------------------
59
75
std::string Point::str(bool verbose) const
60
76
{
61
77
  std::stringstream s;