intsect2.cpp

来自「C++ 这是国外计算机科学教材系列《big C++》书籍的源代码ch3」· C++ 代码 · 共 28 行

CPP
28
字号
#include "ccc_win.h"
#include <cmath>
using namespace std;

int ccc_win_main()
{  
   double radius = cwin.get_double("Radius: ");
   Circle c(Point(0, 0), radius);

   double b = cwin.get_double("Line position: ");
   Line s(Point(-10, b), Point(10, b));

   cwin << c << s;

   double root = sqrt(radius * radius - b * b);
   
   Point p1(root, b);
   Point p2(-root, b);

   Message m1(p1, p1.get_x());
   Message m2(p2, p2.get_x());

   cwin << p1 << p2 << m1 << m2;

   return 0;
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?