資源簡介
四參數(shù)計(jì)算類代碼,實(shí)現(xiàn)知道2個(gè)以上公共點(diǎn)的坐標(biāo)求出四個(gè)轉(zhuǎn)換參數(shù)
代碼片段和文件信息
package?com.android.test.test;
import?android.content.pm.ActivityInfo;
import?android.widget.Toast;
/**
?*?Created?by?11920?on?2017/5/12.
?*/
public?class?FourParaChange?{
????private?double?dxdyKdAngle;
????public?FourParaChange?(Matrix?MP)?{
????????int?iCol?=?MP.getCol();//MP矩陣的列數(shù)【X?Y?x?y】
????????int?iRow?=?MP.getRow();//MP矩陣【X?Y?x?y】的行數(shù),等價(jià)于已知的公共點(diǎn)個(gè)數(shù)
????????if?(iRow?2?||?iCol?!=?4)
????????{
??????????return;
????????}
????????//方程:A*X=Mb
???//構(gòu)建系數(shù)矩陣A?和?Mb
????????Matrix?A=new?Matrix(2?*?iRow?4);/*??A=X?-Y?1?0
???????????????????Y??X?0?1???*/
????????Matrix?Mb=new?Matrix(2?*?iRow?1);//b=?~[x?y]
????????int?j?=?0;
????????for?(int?i?=?0;?i?2?*?iRow;?i?+=?2)
????????{
????????????double?X?=?MP.getElem(j?0)?Y?=?MP.getElem(j?1);
????????????A.setElem(i?0X);
????????????A.setElem(i?1-Y);
????????????A.setElem(i?21);
????????????A.setElem(i?30);
????????????A.setElem(i?+?1?0Y);
????????????A.setElem(i?+?1?1X);
?
評論
共有 條評論