if (vector_from_axis.norm() <= 1e-10 * middle.norm())
return middle;
else
- return (vector_from_axis / vector_from_axis.norm() * radius +
- ((middle-point_on_axis) * direction) * direction +
- point_on_axis);
+ return Point<spacedim>(vector_from_axis / vector_from_axis.norm() * radius +
+ ((middle-point_on_axis) * direction) * direction +
+ point_on_axis);
}
if (vector_from_axis.norm() <= 1e-10 * middle.norm())
return middle;
else
- return (vector_from_axis / vector_from_axis.norm() * radius +
- ((middle-point_on_axis) * direction) * direction +
- point_on_axis);
+ return Point<3>(vector_from_axis / vector_from_axis.norm() * radius +
+ ((middle-point_on_axis) * direction) * direction +
+ point_on_axis);
}
template<>
if (vector_from_axis.norm() <= 1e-10 * middle.norm())
return middle;
else
- return (vector_from_axis / vector_from_axis.norm() * radius +
- ((middle-point_on_axis) * direction) * direction +
- point_on_axis);
+ return Point<3>(vector_from_axis / vector_from_axis.norm() * radius +
+ ((middle-point_on_axis) * direction) * direction +
+ point_on_axis);
}
if (vector_from_axis.norm() <= 1e-10 * middle.norm())
points[i] = middle;
else
- points[i] = (vector_from_axis / vector_from_axis.norm() * radius +
- ((middle-point_on_axis) * direction) * direction +
- point_on_axis);
+ points[i] = Point<spacedim>(vector_from_axis / vector_from_axis.norm() * radius +
+ ((middle-point_on_axis) * direction) * direction +
+ point_on_axis);
}
}
const Point<dim> vertex_p = x_0 + c * axis;
// Then compute the vector pointing from the point <tt>vertex_p</tt> on
// the axis to the vertex.
- const Point<dim> axis_to_vertex = face->vertex (vertex) - vertex_p;
+ const Tensor<1,dim> axis_to_vertex = face->vertex (vertex) - vertex_p;
face_vertex_normals[vertex] = axis_to_vertex / axis_to_vertex.norm ();
}
double r=0;
if (compute_radius_automatically)
- {
- const Point<spacedim> vertex_relative = line->vertex(0) - center;
- r = std::sqrt(vertex_relative.square());
- }
+ r = (line->vertex(0) - center).norm();
else
- r=radius;
+ r = radius;
+
// project to boundary
middle *= r / std::sqrt(middle.square());
middle += center;
double r=0;
if (compute_radius_automatically)
- {
- const Point<spacedim> vertex_relative = quad->vertex(0) - center;
- r = std::sqrt(vertex_relative.square());
- }
+ r = (quad->vertex(0) - center).norm();
else
- r=radius;
+ r = radius;
+
// project to boundary
middle *= r / std::sqrt(middle.square());
double eps=1e-12;
double r=0;
if (compute_radius_automatically)
- {
- const Point<spacedim> vertex_relative = p0 - center;
- r = std::sqrt(vertex_relative.square());
- }
+ r = (p0 - center).norm();
else
- r=radius;
+ r = radius;
const double r2=r*r;
Assert(std::fabs(v1*v1-r2)<eps*r2, ExcInternalError());
const double alpha=std::acos((v0*v1)/std::sqrt((v0*v0)*(v1*v1)));
- const Point<spacedim> pm=0.5*(v0+v1);
+ const Tensor<1,spacedim> pm=0.5*(v0+v1);
- const double h=std::sqrt(pm.square());
+ const double h=pm.norm();
// n even: m=n/2,
// n odd: m=(n-1)/2
for (unsigned int i=0; i<m ; ++i)
{
const double beta = alpha * (line_points[i+1][0]-0.5);
- const double d=h*std::tan(beta);
- points[i]=pm+d/length*(v1-v0);
- points[n-1-i]=pm-d/length*(v1-v0);
+ const double d = h*std::tan(beta);
+ points[i] = Point<spacedim>(pm+d/length*(v1-v0));
+ points[n-1-i] = Point<spacedim>(pm-d/length*(v1-v0));
}
if ((n+1)%2==0)
// if the number of parts is even insert the midpoint
- points[(n-1)/2]=pm;
+ points[(n-1)/2] = Point<spacedim>(pm);
// project the points from the straight line to the HyperBallBoundary
{
const Point<dim> quad_center = (quad->vertex(0) + quad->vertex(1) +
quad->vertex(2) + quad->vertex(3) )/4;
- const Point<dim> quad_center_offset = quad_center - this->center;
+ const Tensor<1,dim> quad_center_offset = quad_center - this->center;
if (std::fabs (quad->line(0)->center().distance(this->center) -