mirror of https://github.com/CGAL/cgal
Interpolation
This commit is contained in:
parent
cb58f1bda8
commit
9eaeb04023
|
|
@ -43,9 +43,9 @@ int main()
|
||||||
CGAL:: Data_access<Point_value_map>(value_function),
|
CGAL:: Data_access<Point_value_map>(value_function),
|
||||||
Traits());
|
Traits());
|
||||||
|
|
||||||
for(Point_vector_map::iterator it = gradient_function.begin(); it != gradient_function.end(); ++it)
|
for(const Point_vector_map::value_type& pv : gradient_function)
|
||||||
{
|
{
|
||||||
std::cout << it->first << " " << it->second << std::endl;
|
std::cout << pv.first << " " << pv.second << std::endl;
|
||||||
}
|
}
|
||||||
// coordinate computation
|
// coordinate computation
|
||||||
K::Point_2 p(1.6, 1.4);
|
K::Point_2 p(1.6, 1.4);
|
||||||
|
|
|
||||||
|
|
@ -52,9 +52,8 @@ int main()
|
||||||
CGAL::Data_access<Point_value_map>(value_function),
|
CGAL::Data_access<Point_value_map>(value_function),
|
||||||
Traits());
|
Traits());
|
||||||
|
|
||||||
for(Point_vector_map::iterator it = gradient_function.begin();
|
for(const Point_vector_map::value_type& pv : gradient_function) {
|
||||||
it != gradient_function.end(); ++it) {
|
std::cout << pv.first << " " << pv.second << std::endl;
|
||||||
std::cout << it->first << " " << it->second << std::endl;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//coordinate computation
|
//coordinate computation
|
||||||
|
|
|
||||||
|
|
@ -48,9 +48,8 @@ int main()
|
||||||
|
|
||||||
std::cout << "Testing the barycentric property " << std::endl;
|
std::cout << "Testing the barycentric property " << std::endl;
|
||||||
Point_3 b(0, 0, 0);
|
Point_3 b(0, 0, 0);
|
||||||
for(std::vector< std::pair< Point_3, Coord_type > >::const_iterator
|
for(const std::pair< Point_3, Coord_type >& pc : coords)
|
||||||
it = coords.begin(); it!=coords.end(); ++it)
|
b = b + (pc.second/norm) * (pc.first - CGAL::ORIGIN);
|
||||||
b = b + (it->second/norm) * (it->first - CGAL::ORIGIN);
|
|
||||||
|
|
||||||
std::cout << " weighted barycenter: " << b <<std::endl;
|
std::cout << " weighted barycenter: " << b <<std::endl;
|
||||||
std::cout << " squared distance: " << CGAL::squared_distance(p,b) << std::endl;
|
std::cout << " squared distance: " << CGAL::squared_distance(p,b) << std::endl;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue