本文整理汇总了C++中Curve::create_custom方法的典型用法代码示例。如果您正苦于以下问题:C++ Curve::create_custom方法的具体用法?C++ Curve::create_custom怎么用?C++ Curve::create_custom使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Curve
的用法示例。
在下文中一共展示了Curve::create_custom方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: nearest_exterior_triangle
void Triangulation::nearest_exterior_triangle(unsigned int &output_index, double &alpha, double &beta, double &gamma,
const Point &point) const
{
unsigned int i;
double distance, distance_min;
Point proj;
Curve tri;
Triangle triangle;
std::vector<Point> nodes;
std::vector<complex_number> tangents;
nodes.resize(3);
i = nb_interior_triangles_;
triangle = get_triangle(i);
triangle.get_ABC(nodes[0], nodes[1], nodes[2]);
tri.create_custom(nodes, tangents);
tri.point_projection(proj, point);
distance_min = norm(proj.get_affix() - point.get_affix());
output_index = i;
for(i=nb_interior_triangles_+1; i<triangles_.size(); i++)
{
if(!triangle.barycentric_coordinates(alpha, beta, gamma, point))
{
continue;
}
triangle = get_triangle(i);
triangle.get_ABC(nodes[0], nodes[1], nodes[2]);
tri.create_custom(nodes, tangents);
tri.point_projection(proj, point);
distance = norm(proj.get_affix() - point.get_affix());
if(distance < distance_min )
{
distance_min = distance;
output_index = i;
}
}
triangle = get_triangle(output_index);
triangle.barycentric_coordinates(alpha,beta,gamma,point);
return;
}