h1(0) * h2(1) - h1(1) * h2(0);
// normalize Vector
- double norm = std::sqrt(
- Utilities::fixed_power<2>(nrml[i * d1 + j * d2](0)) +
- Utilities::fixed_power<2>(nrml[i * d1 + j * d2](1)) +
- Utilities::fixed_power<2>(nrml[i * d1 + j * d2](2)));
+ double norm = std::hypot(nrml[i * d1 + j * d2](0),
+ nrml[i * d1 + j * d2](1),
+ nrml[i * d1 + j * d2](2));
if (nrml[i * d1 + j * d2](1) < 0)
norm *= -1.;
std::max(x_dimension, y_dimension);
}
- const double distance_to_camera = std::sqrt(
- Utilities::fixed_power<2>(point[0] - camera_position[0]) +
- Utilities::fixed_power<2>(point[1] - camera_position[1]) +
- Utilities::fixed_power<2>(point[2] - camera_position[2]));
+ const double distance_to_camera =
+ std::hypot(point[0] - camera_position[0],
+ point[1] - camera_position[1],
+ point[2] - camera_position[2]);
const double distance_factor =
distance_to_camera / (2. * std::max(x_dimension, y_dimension));
if (svg_flags.label_boundary_id)
{
const double distance_to_camera =
- std::sqrt(Utilities::fixed_power<2>(
- point[0] - camera_position[0]) +
- Utilities::fixed_power<2>(
- point[1] - camera_position[1]) +
- Utilities::fixed_power<2>(
- point[2] - camera_position[2]));
+ std::hypot(point[0] - camera_position[0],
+ point[1] - camera_position[1],
+ point[2] - camera_position[2]);
const double distance_factor =
distance_to_camera /
(2. * std::max(x_dimension, y_dimension));