<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>

                企業??AI智能體構建引擎,智能編排和調試,一鍵部署,支持知識庫和私有化部署方案 廣告
                `` ``` // Project1tuxing18light1002.cpp : 定義應用程序的入口點。 // #include "stdafx.h" #include "Project1tuxing18light1002.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_PROJECT1TUXING18LIGHT1002, szWindowClass, MAX_LOADSTRING); MyRegisterClass(hInstance); // 執行應用程序初始化: if (!InitInstance (hInstance, nCmdShow)) { return FALSE; } HACCEL hAccelTable = LoadAccelerators(hInstance, MAKEINTRESOURCE(IDC_PROJECT1TUXING18LIGHT1002)); 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_PROJECT1TUXING18LIGHT1002)); wcex.hCursor = LoadCursor(nullptr, IDC_ARROW); wcex.hbrBackground = (HBRUSH)(COLOR_WINDOW+1); wcex.lpszMenuName = MAKEINTRESOURCEW(IDC_PROJECT1TUXING18LIGHT1002); 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; } // // // //將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; } // struct RGBstruc1 { int r; int g; int b; }; 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 ); } // 函數: WndProc(HWND, UINT, WPARAM, LPARAM) // // 目標: 處理主窗口的消息。 // // WM_COMMAND - 處理應用程序菜單 // WM_PAINT - 繪制主窗口 // WM_DESTROY - 發送退出消息并返回 // // 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: {//case110 PAINTSTRUCT ps; HDC hdc = BeginPaint(hWnd, &ps); HPEN hpen; // TODO: 在此處添加使用 hdc 的任何繪圖代碼... // //輸出文本-PI值 char cha40a01[40]; uint64_t uint64pi = (uint64_t)(Multi18_PI/10000000000); //10個0 long double d_64 = (long double)(Multi18_PI / 1000000000); //9 std::cout << uint64pi << 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 x01_100 = 100; int y01_100 = 100; MoveToEx(hdc, x01_100, y01_100, NULL); LineTo(hdc, 200, 150); // // 畫圓 1號圓 int r1_100 = 100; //圓心: int c01_x00 = 200; int c01_y00 = 200; //畫個圓 i1i為角度值(非弧度 //圓的密度 稱10 for (int i1i = 0; i1i <= 10*350; ++i1i) { //for220 //for (int i1i = 0; i1i <= 360; ++i1i) { //for220 // long double hu1du001 = Multi18_PI* i1i / 180; //轉成弧度 10^18倍的弧度 long double hu1du001 = (long double)Multi18_PI / 10000 * i1i / 10 / 180 / 100000000000000;//先 降4個0 最后再降14個(共18個) int x001 = cos(hu1du001) *r1_100; int y001 = sin(hu1du001)*r1_100; SetPixel(hdc, x001 + c01_x00 , y001 + c01_y00, RGB(0, 0, 227));//127)); }//for220 //畫反射 // long double hu2du01 = 3;// 2; //{////畫反射1 MoveToEx(hdc, c01_x00, c01_y00, NULL); uint64_t tt = 0; //tt時間 int flag01 = 0;//(每次相交(橫縱坐標相等后)只反轉1次 int IsFanZhuan = 0; int r01t01 = 0;// 240; int numColor = 0; for (uint64_t t1 = 0; t1 <= 260; ++t1) {//for330 int x01 = cos(hu2du01)*r01t01;// t1; int y01 = sin(hu2du01)*r01t01;// t1; //取顏色 //HPEN = hpen; hpen = CreatePen( PS_SOLID, 1, getColorRGB1(numColor % 7) ); //取顏色end SetPixel(hdc, x01 + c01_x00, y01 + c01_y00, getColorRGB1( (numColor+1) % 7)); // RGB(0, 200, 0)); SetPixel(hdc, x01 + c01_x00 +1, y01 + c01_y00+1, getColorRGB1((numColor + 1) % 7)); SetPixel(hdc, x01 + c01_x00+1, y01 + c01_y00, getColorRGB1( (numColor+1) % 7)); SetPixel(hdc, x01 + c01_x00, y01 + c01_y00+1, getColorRGB1((numColor + 1) % 7)); //// //輸出變量(到文本 char char30a02[30]; _itoa_s(x01, char30a02, 10); TCHAR szText01x[30]; CharToTchar(char30a02, szText01x); TextOut(hdc, 410, 20, szText01x, wcslen(szText01x)); //輸出變量(到文本-end //是否相交呢? int IsXiangjiao = 0; for (int i1i = 0; i1i <= 360; ++i1i) {//for440 //for (int i1i=0;i1i<=10*360; ++i1i ) {//for440 long double hu1du001 = (long double)Multi18_PI / 10000 * i1i /*/ 10*/ / 180 / 100000000000000;//先 降4個0 最后再降14個(共18個) int x001 = cos(hu1du001) * r1_100; int y001 = sin(hu1du001)* r1_100; //輸出變量(到文本 char char30a02[30]; _itoa_s(x01, char30a02, 10); TCHAR szText01x[30]; CharToTchar(char30a02, szText01x); TextOut(hdc, 450, 40, szText01x, wcslen(szText01x)); //輸出變量(到文本-end if ((x01/2 == (x001/2 )) && (y01 == (y001 ))) {//if550 //和圓撞上了! IsXiangjiao = 1; if (0 == flag01) { IsFanZhuan = (1==IsFanZhuan) ? 0 : 1; //乒乓標志,翻轉! IsFanZhuan = 1; // long double hu2du002 = PId - hu2du01; // hu2du01 = hu2du01 + 0.1; hu2du01 = hu2du01 + 2 * 3.12;//+ 2*3.14; flag01 ++; //相等過一次,就反轉(過)了,記住,不要再進來反轉(這個相當于“單例模式(設計模型)”!) ++numColor; } // hu2du002; //只反轉1次 }//if550 }//for440 //下面進入(射線的)下一個點的計算和檢測 if (0 != flag01 && (1!=IsXiangjiao) )//if550elseif560//不(再)相交了 { flag01 = 0; }////if550elseif560 既然不相等了,flag01趕快復位! if (0 == IsFanZhuan) { r01t01++; } else { r01t01--; } }//for330 //}////畫反射1end // // 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>

                              哎呀哎呀视频在线观看