<ruby id="bdb3f"></ruby>

    <p id="bdb3f"><cite id="bdb3f"></cite></p>

      <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
        <p id="bdb3f"><cite id="bdb3f"></cite></p>

          <pre id="bdb3f"></pre>
          <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

          <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
          <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

          <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                <ruby id="bdb3f"></ruby>

                ThinkChat2.0新版上線,更智能更精彩,支持會話、畫圖、視頻、閱讀、搜索等,送10W Token,即刻開啟你的AI之旅 廣告
                先上結果(圖): ![](https://box.kancloud.cn/fe9dc4e44de33ed33462a99c07bc82b8_502x501.png) `` ``` // Project1light2translate181003.cpp : 定義應用程序的入口點。 // #include "stdafx.h" #include "Project1light2translate181003.h" #include <iostream> #define MAX_LOADSTRING 100 // 12345678901234567890123456789012345678901234567890 #define PId 3.14159265358979323846264338327950288419716939937510f //雙精度的PI #define PIuint64 3141592653589793238Ui64 // 12345678901234567890123456789012345678901234567890 #define Multi18_PI 3141592653589793238 #define Multi18fmDeno 1000000000000000000 //18個0 // 全局變量: HINSTANCE hInst; // 當前實例 WCHAR szTitle[MAX_LOADSTRING]; // 標題欄文本 WCHAR szWindowClass[MAX_LOADSTRING]; // 主窗口類名 // 此代碼模塊中包含的函數的前向聲明: ATOM MyRegisterClass(HINSTANCE hInstance); BOOL InitInstance(HINSTANCE, int); LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM); INT_PTR CALLBACK About(HWND, UINT, WPARAM, LPARAM); int APIENTRY wWinMain(_In_ HINSTANCE hInstance, _In_opt_ HINSTANCE hPrevInstance, _In_ LPWSTR lpCmdLine, _In_ int nCmdShow) { UNREFERENCED_PARAMETER(hPrevInstance); UNREFERENCED_PARAMETER(lpCmdLine); // TODO: 在此處放置代碼。 // 初始化全局字符串 LoadStringW(hInstance, IDS_APP_TITLE, szTitle, MAX_LOADSTRING); LoadStringW(hInstance, IDC_PROJECT1LIGHT2TRANSLATE181003, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // 執行應用程序初始化: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_PROJECT1LIGHT2TRANSLATE181003)); MSG msg; // 主消息循環: while (GetMessage(&msg, nullptr, 0, 0)) { if (!TranslateAccelerator(msg.hwnd, hAccelTable, &msg)) { TranslateMessage(&msg); DispatchMessage(&msg); } } return (int) msg.wParam; } // // 函數: MyRegisterClass() // // 目標: 注冊窗口類。 // ATOM MyRegisterClass(HINSTANCE hInstance) { WNDCLASSEXW wcex; wcex.cbSize = sizeof(WNDCLASSEX); wcex.style = CS_HREDRAW | CS_VREDRAW; wcex.lpfnWndProc = WndProc; wcex.cbClsExtra = 0; wcex.cbWndExtra = 0; wcex.hInstance = hInstance; wcex.hIcon = LoadIcon(hInstance, MAKEINTRESOURCE(IDI_PROJECT1LIGHT2TRANSLATE181003)); wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_PROJECT1LIGHT2TRANSLATE181003); wcex.lpszClassName = szWindowClass; wcex.hIconSm = LoadIcon(wcex.hInstance, MAKEINTRESOURCE(IDI_SMALL)); return RegisterClassExW(&wcex); } // // 函數: InitInstance(HINSTANCE, int) // // 目標: 保存實例句柄并創建主窗口 // // 注釋: // // 在此函數中,我們在全局變量中保存實例句柄并 // 創建和顯示主程序窗口。 // BOOL InitInstance(HINSTANCE hInstance, int nCmdShow) { hInst = hInstance; // 將實例句柄存儲在全局變量中 HWND hWnd = CreateWindowW(szWindowClass, szTitle, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, 0, CW_USEDEFAULT, 0, nullptr, nullptr, hInstance, nullptr); if (!hWnd) { return FALSE; } ShowWindow(hWnd, nCmdShow); UpdateWindow(hWnd); return TRUE; } // // 函數: WndProc(HWND, UINT, WPARAM, LPARAM) // // 目標: 處理主窗口的消息。 // // WM_COMMAND - 處理應用程序菜單 // WM_PAINT - 繪制主窗口 // WM_DESTROY - 發送退出消息并返回 // // //將TCHAR轉為char //*tchar是TCHAR類型指針,*_char是char類型指針 int TcharToChar(const TCHAR * tchar, char * _char) { int iLength; //獲取字節長度 iLength = WideCharToMultiByte(CP_ACP, 0, tchar, -1, NULL, 0, NULL, NULL); //將tchar值賦給_char WideCharToMultiByte(CP_ACP, 0, tchar, -1, _char, iLength, NULL, NULL); return 1; } //同上*tchar是TCHAR類型指針,*_char是char類型指針 int CharToTchar(const char * _char, TCHAR * tchar) { int iLength; iLength = MultiByteToWideChar(CP_ACP, 0, _char, strlen(_char) + 1, NULL, 0); MultiByteToWideChar(CP_ACP, 0, _char, strlen(_char) + 1, tchar, iLength); return iLength; } // COLORREF getColorRGB1(int i) { if (0 == i) return (9, 9, 9); if (1 == i) return (0, 0, 200); //藍 if (2 == i) return (0, 180, 0); //綠 if (3 == i) return (160, 0, 0); //紅 if (4 == i) return (200, 0, 200); //品紫 if (5 == i) return (0, 255, 0); //亮綠 if (6 == i) return (0, 255, 255); //亮青 // if(i>=6) return (255, 200, 200); } // // // LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_COMMAND: { int wmId = LOWORD(wParam); // 分析菜單選擇: switch (wmId) { case IDM_ABOUT: DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About); break; case IDM_EXIT: DestroyWindow(hWnd); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } } break; case WM_PAINT: { PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, &ps); // HPEN hpen; // TODO: 在此處添加使用 hdc 的任何繪圖代碼... // //輸出文本-PI值 char cha40a01[40]; long double d_64 = (long double)(Multi18_PI / 1000000000); //9 std::cout << d_64 << std::endl; _itoa_s((Multi18_PI / 10000000000), cha40a01, 10); //現在8*10倍PI;10個0(10000000000ok!) //9個0不行(溢出) TCHAR szText[40]; CharToTchar(cha40a01, szText); TextOut(hdc, 15, 10, szText, wcslen(szText)); //輸出文本-PI值End // // 畫圓 1號圓 int r1_200 = 200;// 100; //圓心: int c01_x00 = 200; int c01_y00 = 200; //畫個圓 i1i01為角度值(非弧度 //圓的密度 //乘10 for (int i1i01 = 0; i1i01 <= 10 * 350; ++i1i01) { //for220 //for (int i1i01 = 0; i1i01 <= 360; ++i1i01) { //for220 // long double hu1du001 = Multi18_PI* i1i01 / 180; //轉成弧度 10^18倍的弧度 long double hu1du001 = (long double)i1i01*(PId/180);// (long double)Multi18_PI / 10000 * i1i01 / 10 / 180 / 100000000000000;//先 降4個0 最后再降14個(共18個) int x001 = cos(hu1du001) *r1_200; int y001 = sin(hu1du001)*r1_200; // SetPixel(hdc, x001 + c01_x00, y001 + c01_y00, RGB(0, 0, 227));//127)); }//for220 // //畫發射線 // long double hu2du01 = 0;// 1.57;//發射線的 角度 //發射線的初始(出發點) c01_x00 = 200; c01_y00 = 200; int Xpianyi90 = 90; int Ypianyi40 = 40; int lightX00start = c01_x00 + Xpianyi90; int lightY00start = c01_y00 + Ypianyi40; MoveToEx(hdc, lightX00start, lightY00start, NULL); //逐點畫光 uint64_t r01t01=0; int numColor = 0; int flagHaveFirst01 = 0; int FanZhuanTimes = 0; double newJiao2du = 0; int newhalfBanjin2g = 0; int newBan2jing; int xx001 = c01_x00+Xpianyi90; int yy001 = c01_y00 + Ypianyi40;//0; for (uint64_t t1 = 0; t1 <= 9240; ++t1) {//for330 //for (uint64_t t1 = 0; t1 <= 1240; ++t1) {//for330 int x01 = cos(hu2du01)*r01t01; //t1; int y01 = sin(hu2du01)*r01t01; int x010002 = x01 + c01_x00+Xpianyi90;//Xpianyi90; //int x010002 = x01 + lightX00start; int y010002 = y01 + c01_y00+Ypianyi40;//Ypianyi40; //int y010002 = y01 + lightY00start; if(1==FanZhuanTimes%2 ) {//if7700 x01 = cos(hu2du01)* r01t01;// newBan2jing;//*r01t01; //t1; y01 = sin(hu2du01)* r01t01;// newBan2jing;////*r01t01; x010002 = xx001 -x01; //x010002 = x01 + xx001; y010002 = y01 + yy001; }//if7700 if (0 == FanZhuanTimes % 2) { x01 = cos(hu2du01)* r01t01;// newBan2jing;//*r01t01; //t1; y01 = sin(hu2du01)* r01t01;// newBan2jing;////*r01t01; x010002 = xx001 +x01; //x010002 = x01 + xx001; y010002 = y01 + yy001; } //取顏色 HPEN hpen; hpen = CreatePen(PS_SOLID, 1, getColorRGB1(numColor % 7)); SetPixel(hdc, x010002, y010002, getColorRGB1((numColor + 1) % 7)); // //SetPixel(hdc, x010002, y010002, getColorRGB1((numColor + 1) % 7)); // //取顏色end //下面判斷是否相交 int IsXiangJiao = 0; int r200r = r1_200; for (int i1i = 0; i1i <= 720; ++i1i) {//for440 long double hu1du001 = (long double)i1i*((long double)PId / 180);//(long double)Multi18_PI / 10000 * i1i / 180 / 100000000000000;//先除10000后除10^14 int x0101 = cos(hu1du001) * r1_200; int y0101 = sin(hu1du001)* r1_200; int x01001 = x0101 + c01_x00; int y01001 = y0101 + c01_y00; SetPixel(hdc, x01001 , y01001 , RGB(0, 0, 227));// SetPixel(hdc, x01001+c01_x00 , y01001+c01_y00 , RGB(0, 0, 227));// //if碰撞(重疊 if ((x010002 / 10 == ((x01001) / 10)) && (y010002 / 4 == (y01001 / 4))) {//if550 //if ((x010002 / 4 == ((x01001) / 4)) && (y010002 / 4 == (y01001 / 4))) {//if550 IsXiangJiao = 1; if (0 == flagHaveFirst01) {//if5600 //hu2du01 = -hu2du01 ; FanZhuanTimes++; flagHaveFirst01++; ++numColor; // xx001 = x01001; yy001 = y01001; r01t01 = 0; //半徑初始化了! //輸出文本-值 char cha30a01[30]; _itoa_s((FanZhuanTimes),cha30a01, 10); // TCHAR szTex02t[30]; CharToTchar(cha30a01, szTex02t); TextOut(hdc, 405, 100, szTex02t, wcslen(szTex02t)); //輸出文本-值End //算新元 圓02b號 情況 //新圓 半徑 等于 2* newJiao2du = asin( (double)Ypianyi40 / r200r); _itoa_s(( 100*newJiao2du), cha30a01, 10); // TCHAR szTex03t[30]; CharToTchar(cha30a01, szTex03t); TextOut(hdc, 420, 150, szTex03t, wcslen(szTex03t)); if(1==(FanZhuanTimes%2) ) hu2du01 = -hu2du01- 2*newJiao2du; else hu2du01 = -hu2du01+ 2*newJiao2du; if (6.28 < hu2du01) hu2du01 -= 6.28; if (0 > hu2du01) hu2du01 += 6.28; newhalfBanjin2g = cos(newJiao2du); newBan2jing = 2 * newhalfBanjin2g; //算新元 圓02b號 情況end // }//if5600 }//if550 //if碰撞(重疊end }//for440 if (0 != flagHaveFirst01 && (1 != IsXiangJiao)) { flagHaveFirst01 = 0; } //不(再)相交了//既然不相等了,flag01趕快復位! //判斷是否相交end if (0 == FanZhuanTimes ) { //% 2) {//if 6600 r01t01++; //延長光線! }//if6600 else { r01t01++; } }//for330 //逐點畫光end //畫發射線end // // EndPaint(hWnd, &ps); }//case110 //case WM_PAINT break; case WM_DESTROY: PostQuitMessage(0); break; default: return DefWindowProc(hWnd, message, wParam, lParam); } return 0; } // “關于”框的消息處理程序。 INT_PTR CALLBACK About(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { UNREFERENCED_PARAMETER(lParam); switch (message) { case WM_INITDIALOG: return (INT_PTR)TRUE; case WM_COMMAND: if (LOWORD(wParam) == IDOK || LOWORD(wParam) == IDCANCEL) { EndDialog(hDlg, LOWORD(wParam)); return (INT_PTR)TRUE; } break; } return (INT_PTR)FALSE; } ```
                  <ruby id="bdb3f"></ruby>

                  <p id="bdb3f"><cite id="bdb3f"></cite></p>

                    <p id="bdb3f"><cite id="bdb3f"><th id="bdb3f"></th></cite></p><p id="bdb3f"></p>
                      <p id="bdb3f"><cite id="bdb3f"></cite></p>

                        <pre id="bdb3f"></pre>
                        <pre id="bdb3f"><del id="bdb3f"><thead id="bdb3f"></thead></del></pre>

                        <ruby id="bdb3f"><mark id="bdb3f"></mark></ruby><ruby id="bdb3f"></ruby>
                        <pre id="bdb3f"><pre id="bdb3f"><mark id="bdb3f"></mark></pre></pre><output id="bdb3f"></output><p id="bdb3f"></p><p id="bdb3f"></p>

                        <pre id="bdb3f"><del id="bdb3f"><progress id="bdb3f"></progress></del></pre>

                              <ruby id="bdb3f"></ruby>

                              哎呀哎呀视频在线观看