Пример #1
0
/* The main program: */
int main ()
{
  // Construct the input planes.
  std::list<Surface_3>   planes;

  planes.push_back (Surface_3(Plane_3(0, -1, 1, 0)));
  planes.push_back (Surface_3(Plane_3(-1, 0, 1, 0)));
  planes.push_back (Surface_3(Plane_3(0, 1 , 1, 0)));
  planes.push_back (Surface_3(Plane_3(1, 0, 1,  0)));

  // Compute and print the minimization diagram.
  Envelope_diagram_2      min_diag;

  CGAL::lower_envelope_3 (planes.begin(), planes.end(), min_diag);

  std::cout << std::endl << "The minimization diagram:" << std::endl;
  print_diagram (min_diag);

  // Compute and print the maximization diagram.
  Envelope_diagram_2      max_diag;

  CGAL::upper_envelope_3 (planes.begin(), planes.end(), max_diag);

  std::cout << std::endl << "The maximization diagram:" << std::endl;
  print_diagram (max_diag);

  return (0);
}
Пример #2
0
int
main(void)
{
    const int ARR_LEN = 10;
    double cels_arr[ARR_LEN] = {-400.45, -300.24, -200.68, -100.45, -50.23, -10.98, 50.76, 100.45, 150.34, 250.93};
    double far_arr[ARR_LEN];

    c_f_conversion(cels_arr, far_arr, ARR_LEN);

    print_diagram(cels_arr, far_arr, ARR_LEN);

    return 0;
}
Пример #3
0
/*! The main program. */
int main ()
{
  // Create four input circles.
  Curve_2          circles[4];

  circles[0] = Circle_2 (Kernel_point_2 (1, 3), CGAL::square(2));
  circles[1] = Circle_2 (Kernel_point_2 (4, 5), CGAL::square(4));
  circles[2] = Circle_2 (Kernel_point_2 (5, 1), CGAL::square(1));
  circles[3] = Circle_2 (Kernel_point_2 (6, 7), CGAL::square(2));

  // Compute the minimization diagram that represents their lower envelope.
  Diagram_1              min_diag;

  lower_envelope_2 (&(circles[0]), &(circles[4]), min_diag);
  print_diagram (min_diag);

  // Compute the maximization diagram that represents the upper envelope.
  Diagram_1              max_diag;

  upper_envelope_2 (&(circles[0]), &(circles[4]), max_diag);
  print_diagram (max_diag);

  return (0);
}