OpenGL中的各種轉換是通過矩陣運算實現的,具體的說,就是當發出一個轉換命令時,該命令會生成一個4X4階的轉換矩陣(OpenGL中的物體坐標一律采用齊次坐標,即(x, y, z, w),故所有變換矩陣都采用4X4矩陣),當前矩陣與這個轉換矩陣相乘,從而生成新的當前矩陣。例如,對于頂點坐標v ,轉換命令通常在頂點坐標命令之前發出,若當前矩陣為C,轉換命令構成的矩陣為M,則發出轉換命令后,生成的新的當前矩陣為CM,這個矩陣再乘以頂點坐標v,從而構成新的頂點坐標CMv。上述過程說明,程序中繪制頂點前的最后一個變換命令最先作用于頂點之上。這同時也說明,OpenGL編程中,實際的變換順序與指定的順序是相反的。文檔對其進行了詳細的分析。
上傳時間: 2016-07-21
上傳用戶:qilin
for entropy H = entropy(S) this command will evaluate the entropy of S, S should be row matrix H = entropy([X Y Z]) this command will find the joint entropy for the 3 variables H = entropy([X,Y],[Z,W]) this will find H(X,Y/Z,W).. you can use it for any combination of joint entropies Please validate this function before using it
標簽: entropy evaluate command matrix
上傳時間: 2017-09-10
上傳用戶:caozhizhi
#include <stdio.h> #include <stdlib.h> #define SMAX 100 typedef struct SPNode { int i,j,v; }SPNode; struct sparmatrix { int rows,cols,terms; SPNode data [SMAX]; }; sparmatrix CreateSparmatrix() { sparmatrix A; printf("\n\t\t請輸入稀疏矩陣的行數,列數和非零元素個數(用逗號隔開):"); scanf("%d,%d,%d",&A.cols,&A.terms); for(int n=0;n<=A.terms-1;n++) { printf("\n\t\t輸入非零元素值(格式:行號,列號,值):"); scanf("%d,%d,%d",&A.data[n].i,&A.data[n].j,&A.data[n].v); } return A; } void ShowSparmatrix(sparmatrix A) { int k; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { k=0; for(int n=0;n<=A.terms-1;n++) { if((A.data[n].i-1==x)&&(A.data[n].j-1==y)) { printf("%8d",A.data[n].v); k=1; } } if(k==0) printf("%8d",k); } printf("\n\t\t"); } } void sumsparmatrix(sparmatrix A) { SPNode *p; p=(SPNode*)malloc(sizeof(SPNode)); p->v=0; int k; k=0; printf("\n\t\t"); for(int x=0;x<=A.rows-1;x++) { for(int y=0;y<=A.cols-1;y++) { for(int n=0;n<=A.terms;n++) { if((A.data[n].i==x)&&(A.data[n].j==y)&&(x==y)) { p->v=p->v+A.data[n].v; k=1; } } } printf("\n\t\t"); } if(k==1) printf("\n\t\t對角線元素的和::%d\n",p->v); else printf("\n\t\t對角線元素的和為::0"); } int main() { int ch=1,choice; struct sparmatrix A; A.terms=0; while(ch) { printf("\n"); printf("\n\t\t 稀疏矩陣的三元組系統 "); printf("\n\t\t*********************************"); printf("\n\t\t 1------------創建 "); printf("\n\t\t 2------------顯示 "); printf("\n\t\t 3------------求對角線元素和"); printf("\n\t\t 4------------返回 "); printf("\n\t\t*********************************"); printf("\n\t\t請選擇菜單號(0-3):"); scanf("%d",&choice); switch(choice) { case 1: A=CreateSparmatrix(); break; case 2: ShowSparmatrix(A); break; case 3: SumSparmatrix(A); break; default: system("cls"); printf("\n\t\t輸入錯誤!請重新輸入!\n"); break; } if (choice==1||choice==2||choice==3) { printf("\n\t\t"); system("pause"); system("cls"); } else system("cls"); } }
上傳時間: 2020-06-11
上傳用戶:ccccy
大型電子製造業后臺數據庫的詳細設計!絕對好東西!(部分刪減)
上傳時間: 2015-05-17
上傳用戶:aa54
鄰接矩陣類的根是A d j a c e n c y W D i g r a p h,因此從這個類開始。程序1 2 - 1給出了類的描述。程 序中,先用程序1 - 1 3中函數Make2DArray 為二組數組a 分配空間,然后對數組a 初始化,以描述 一個n 頂點、沒有邊的圖的鄰接矩陣,其復雜性為( n2 )。該代碼沒有捕獲可能由M a k e 2 D A r r a y 引發的異常。在析構函數中調用了程序1 - 1 4中的二維數組釋放函數D e l e t e 2 D
標簽: 矩陣
上傳時間: 2013-12-21
上傳用戶:lanjisu111
用匯編語言來使鍵盤成為一個演奏音樂的電子琴。高音依次1,2,3,4,5,6,7 。中音依次為q,w,e,r,t,y,u 。低音依次為a,s,d,f,g,h,j
上傳時間: 2013-12-17
上傳用戶:wangdean1101
替代加密: A B C D E F G H I J K L M N O P Q R S T U V W 密文 Y Z D M R N H X J L I O Q U W A C B E G F K P 明文 X Y Z T S V I HAVE A DREAM!# 密文?? 用ARM編程實現替代加密。
標簽: 加密
上傳時間: 2016-07-17
上傳用戶:qq521
SAP R/3 企業系統 數據字典 ABAP programming 必要參考檔
標簽: programming ABAP SAP 系統
上傳時間: 2016-09-24
上傳用戶:zl5712176
電子琴 高音依次為1,2,3,4,5,6,7 中音依次為q,w,e,r,t,y,u 低音依次為a,s,d,f,g,h,j
上傳時間: 2017-01-14
上傳用戶:fnhhs
Grid數據顯示
標簽: Grid
上傳時間: 2015-01-09
上傳用戶:ikemada