亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? vector_math.cpp

?? ncbi源碼
?? CPP
字號:
/* * =========================================================================== * PRODUCTION $Log: vector_math.cpp,v $ * PRODUCTION Revision 1000.2  2004/06/01 18:29:54  gouriano * PRODUCTION PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8 * PRODUCTION * =========================================================================== *//*  $Id: vector_math.cpp,v 1000.2 2004/06/01 18:29:54 gouriano Exp $* ===========================================================================**                            PUBLIC DOMAIN NOTICE*               National Center for Biotechnology Information**  This software/database is a "United States Government Work" under the*  terms of the United States Copyright Act.  It was written as part of*  the author's official duties as a United States Government employee and*  thus cannot be copyrighted.  This software/database is freely available*  to the public for use. The National Library of Medicine and the U.S.*  Government have not placed any restriction on its use or reproduction.**  Although all reasonable efforts have been taken to ensure the accuracy*  and reliability of the software and data, the NLM and the U.S.*  Government do not and cannot warrant the performance or results that*  may be obtained by using this software or data. The NLM and the U.S.*  Government disclaim all warranties, express or implied, including*  warranties of performance, merchantability or fitness for any particular*  purpose.**  Please cite the author in any work or product based on this material.** ===========================================================================** Authors:  Paul Thiessen** File Description:*      Vector and Matrix classes to simplify 3-d geometry calculations** ===========================================================================*/#ifdef _MSC_VER#pragma warning(disable:4018)   // disable signed/unsigned mismatch warning in MSVC#endif#include <ncbi_pch.hpp>#include "vector_math.hpp"BEGIN_SCOPE(Cn3D)void SetTranslationMatrix(Matrix* m, const Vector& v, int n){    m->m[0]=1;  m->m[1]=0;  m->m[2]=0;  m->m[3]=n*v.x;    m->m[4]=0;  m->m[5]=1;  m->m[6]=0;  m->m[7]=n*v.y;    m->m[8]=0;  m->m[9]=0;  m->m[10]=1; m->m[11]=n*v.z;    m->m[12]=0; m->m[13]=0; m->m[14]=0; m->m[15]=1;}void SetScaleMatrix(Matrix* m, const Vector& v){    m->m[0]=v.x; m->m[1]=0;   m->m[2]=0;    m->m[3]=0;    m->m[4]=0;   m->m[5]=v.y; m->m[6]=0;    m->m[7]=0;    m->m[8]=0;   m->m[9]=0;   m->m[10]=v.z; m->m[11]=0;    m->m[12]=0;  m->m[13]=0;  m->m[14]=0;   m->m[15]=1;    return;}void SetRotationMatrix(Matrix* m, const Vector& v, double rad, int n){    double c, s, t;    Vector u(v);    u.normalize();    c=cos(n*rad);    s=sin(n*rad);    t=1.0-c;    m->m[0]=u.x*u.x*t+c;    m->m[1]=u.x*u.y*t-u.z*s;    m->m[2]=u.x*u.z*t+u.y*s;    m->m[3]=0;    m->m[4]=u.x*u.y*t+u.z*s;    m->m[5]=u.y*u.y*t+c;    m->m[6]=u.y*u.z*t-u.x*s;    m->m[7]=0;    m->m[8]=u.x*u.z*t-u.y*s;    m->m[9]=u.y*u.z*t+u.x*s;    m->m[10]=u.z*u.z*t+c;    m->m[11]=0;    m->m[12]=m->m[13]=m->m[14]=0; m->m[15]=1;    return;}void ApplyTransformation(Vector* v, const Matrix& m){    Vector t;    t.x=m.m[0]*v->x + m.m[1]*v->y + m.m[2]*v->z  + m.m[3];    t.y=m.m[4]*v->x + m.m[5]*v->y + m.m[6]*v->z  + m.m[7];    t.z=m.m[8]*v->x + m.m[9]*v->y + m.m[10]*v->z + m.m[11];    *v = t;    return;}// C = A x Bvoid ComposeInto(Matrix* C, const Matrix& A, const Matrix& B){    for (int i=0; i<4; ++i) {        for (int j=0; j<4; ++j) {            C->m[4*i+j]=0;            for (int s=0; s<4; ++s) {                C->m[4*i+j] += (A.m[4*i+s])*(B.m[4*s+j]);            }        }    }    return;}//// The following inverts a 4x4 matrix whose bottom row is { 0 0 0 1 } - i.e.// a matrix composed only of rotate, scale, and translate matrixes.//void InvertInto(Matrix* I, const Matrix& A){    const double&        a=A.m[0], b=A.m[1], c=A.m[2], d=A.m[3],        e=A.m[4], f=A.m[5], g=A.m[6], h=A.m[7],        i=A.m[8], j=A.m[9], k=A.m[10], l=A.m[11];    double denom=(-(c*f*i) + b*g*i + c*e*j - a*g*j - b*e*k + a*f*k);    I->m[0]= (-(g*j) + f*k)/denom;    I->m[1]= (c*j - b*k)/denom;    I->m[2]= (-(c*f) + b*g)/denom;    I->m[3]= (d*g*j - c*h*j - d*f*k + b*h*k + c*f*l - b*g*l)/denom;    I->m[4]= (g*i - e*k)/denom;    I->m[5]= (-(c*i) + a*k)/denom;    I->m[6]= (c*e - a*g)/denom;    I->m[7]= (-(d*g*i) + c*h*i + d*e*k - a*h*k - c*e*l + a*g*l)/denom;    I->m[8]= (-(f*i) + e*j)/denom;    I->m[9]= (b*i - a*j)/denom;    I->m[10]= (-(b*e) + a*f)/denom;    I->m[11]= (d*f*i - b*h*i - d*e*j + a*h*j + b*e*l - a*f*l)/denom;    I->m[12]=0; I->m[13]=0; I->m[14]=0; I->m[15]=1;    return;}//---------------------------------------------------------------------// copied from:  /PROGRAMS/SigmaX2.2/SIGLIB/RigidBody.c////    S*I*G*M*A - 1996 program// revised 1996        J. Hermans, Univ. N. Carolina////     perform rigid body fit for two structures//         (cf. Ferro&Hermans and McLachlan)//// inputs://    natx:          number of atoms//    xref:          reference coordinates//    xvar:          variable coordinates//    Inverse_mass:  inverse weights (1 per atom)//    do_select:     use the Selection array//    selected:      selection array//// outputs://    cgref:     c.o.mass of xref//    cgvar:     c.o.mass of xvar////  NEW xvar = cgref + rot * ( OLD xvar - cgvar ).//  The new xvar will be the best approximation to xref.//---------------------------------------------------------------------// Adapted for Cn3D++ with Vector, Matrix classes by Paul Thiessen.// xvar Vectors are left unchanged; instead, the transformations necessary// to superimpose the variable structure onto the reference structure// are returned in cgref, cgvar, and rotMat. The transformation process is:// 1) translate variable so its center of mass is at origin; 2) apply// rotation in rotMat; 3) translate variable so its center of mass is// at center of mass of reference.void RigidBodyFit(    int natx, const Vector * const *xref, const Vector * const *xvar, const double *weights,    Vector& cgref, Vector& cgvar, Matrix& rotMat){    Vector  t, phi, cosin, sine;    double  rot[3][3], corlnmatrx[3][3];    int     flag1, flag2, flag3;    int     i, j, iatv, ix;    double  an2, xx, f, fz, sgn, del, phix, phibes;    double  tol = .0001;    // compute centroids    cgref *= 0;    cgvar *= 0;    an2 = 0.;    for (iatv=0; iatv<natx; ++iatv) {        if (weights[iatv] <= 0.) continue;        an2 += weights[iatv];        cgref += *(xref[iatv]) * weights[iatv];        cgvar += *(xvar[iatv]) * weights[iatv];    }    cgref /= an2;    cgvar /= an2;    // compute correlation matrix    for (i=0; i<3; ++i) {        cosin[i] = 1.;        for (j=0; j<3; ++j) {            corlnmatrx[i][j] = 0.;        }    }    for (iatv=0; iatv<natx; ++iatv) {        for (i=0; i<3; ++i) {            if (weights[iatv] <= 0.) continue;            xx = ((*(xvar[iatv]))[i] - cgvar[i]) * weights[iatv];            for (j=0; j<3; ++j) {                corlnmatrx[i][j] += xx * ((*(xref[iatv]))[j] - cgref[j]);            }        }    }    // evaluate rotation matrix iteratively    flag1 = flag2 = flag3 = false;    ix = 0;    del = .5;    sgn = 1.;    phibes = phix = 0.;    while (true) {        cosin[ix] = cos(phix);        sine[ix] = sin(phix);        rot[0][0] = cosin[1] * cosin[2];        rot[1][0] = cosin[1] * sine[2];        rot[0][1] = sine[0] * sine[1] * cosin[2] - cosin[0] * sine[2];        rot[1][1] = sine[0] * sine[1] * sine[2] + cosin[0] * cosin[2];        rot[2][0] = -sine[1];        rot[2][1] = sine[0] * cosin[1];        rot[2][2] = cosin[0] * cosin[1];        rot[0][2] = cosin[0] * sine[1] * cosin[2] + sine[0] * sine[2];        rot[1][2] = cosin[0] * sine[1] * sine[2] - sine[0] * cosin[2];        // compute the trace of (rot x corlnmatrix)        f = 0.;        for (i=0; i<3; ++i) {            for (j=0; j<3; ++j) {                f += rot[i][j] * corlnmatrx[i][j];            }        }        if (!flag3) {            fz = f;            flag3 = true;            phix = phibes + sgn * del;            phi[ix] = phix;            continue;        }        if (f > fz) {            // f went down, try again with same difference.            fz = f;            flag1 = true;            phibes = phi[ix];            flag2 = false;            phix = phibes + sgn * del;            phi[ix] = phix;            continue;        }        if (!flag1) {            // try in the opposite direction            sgn = -sgn;            flag1 = true;            phix = phibes + sgn * del;            phi[ix] = phix;            continue;        }        phi[ix] = phibes;        cosin[ix] = cos(phibes);        sine[ix] = sin(phibes);        flag1 = false;        if (ix < 2) {            // apply the same del to the next Euler angle            ++ix;            phibes = phi[ix];            phi[ix] = phix = phibes + sgn * del;            continue;        }        if (flag2) {            // cut del in half            flag2 = false;            del *= .5;            if (del < tol) break;        } else {            flag2 = true;        }        ix = 0;        phibes = phi[ix];        phix = phibes + sgn * del;        phi[ix] = phix;    }    // end iterative evaluation of rotation matrix    // store computed rotation matrix in rotMat    rotMat.SetToIdentity();    for (i=0; i<3; ++i) {        for (j=0; j<3; ++j) {            rotMat[4*i + j] = rot[j][i];        }    }} // end RigidBodyFit()END_SCOPE(Cn3D)/** ---------------------------------------------------------------------------* $Log: vector_math.cpp,v $* Revision 1000.2  2004/06/01 18:29:54  gouriano* PRODUCTION: UPGRADED [GCC34_MSVC7] Dev-tree R1.8** Revision 1.8  2004/05/21 21:41:40  gorelenk* Added PCH ncbi_pch.hpp** Revision 1.7  2004/03/15 18:38:52  thiessen* prefer prefix vs. postfix ++/-- operators** Revision 1.6  2004/02/19 17:05:22  thiessen* remove cn3d/ from include paths; add pragma to disable annoying msvc warning** Revision 1.5  2003/02/03 19:20:08  thiessen* format changes: move CVS Log to bottom of file, remove std:: from .cpp files, and use new diagnostic macros** Revision 1.4  2001/02/09 20:17:32  thiessen* ignore atoms w/o alpha when doing structure realignment** Revision 1.3  2000/11/13 18:06:53  thiessen* working structure re-superpositioning** Revision 1.2  2000/07/17 22:37:18  thiessen* fix vector_math typo; correctly set initial view** Revision 1.1  2000/06/27 20:09:41  thiessen* initial checkin**/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美唯美清纯偷拍| 亚洲精品综合在线| 欧美色图在线观看| 在线看不卡av| 色婷婷综合在线| 精品久久国产字幕高潮| 亚洲欧美经典视频| 91色在线porny| 紧缚奴在线一区二区三区| 亚洲成人福利片| 日本最新不卡在线| 久久国产麻豆精品| 国产精品羞羞答答xxdd| 国产99久久久国产精品潘金 | 色偷偷88欧美精品久久久| 北岛玲一区二区三区四区| 99精品在线免费| 欧美视频一区二区在线观看| 欧美系列日韩一区| 日韩一级完整毛片| 精品电影一区二区三区| 国产精品丝袜91| 国产欧美日韩在线| 亚洲精品大片www| 免费一级欧美片在线观看| 麻豆精品视频在线观看| 国产999精品久久久久久绿帽| www.亚洲色图| 日韩vs国产vs欧美| 久久精品国产网站| 亚洲va天堂va国产va久| 狠狠色丁香久久婷婷综合_中| 蜜桃一区二区三区在线| 成av人片一区二区| 成人18视频在线播放| 欧美日韩卡一卡二| 欧美日韩精品一区二区| 日韩欧美三级在线| 欧美成人精品福利| 中文字幕日韩一区二区| 色屁屁一区二区| 91免费在线视频观看| 欧美亚洲综合另类| 韩国欧美国产1区| 91麻豆精东视频| 91精品国产色综合久久不卡电影| 91精品免费在线| 久久成人精品无人区| 精品午夜一区二区三区在线观看| 91久久线看在观草草青青| 欧美日本在线播放| 欧美日韩小视频| 亚洲精品一区二区三区影院 | 亚洲精品中文字幕乱码三区| 一区二区三区四区乱视频| 亚洲国产精品久久人人爱蜜臀| 亚洲在线视频网站| 午夜在线成人av| 午夜影院久久久| 麻豆91在线观看| 国产精品一区二区三区99| 国产不卡视频一区二区三区| 成人性视频免费网站| 91网站最新地址| 欧美色区777第一页| 69堂国产成人免费视频| 欧美成人伊人久久综合网| 精品国产精品网麻豆系列| 中文字幕第一页久久| 亚洲婷婷综合色高清在线| 亚洲午夜国产一区99re久久| 日本视频一区二区| 成人手机电影网| 色哦色哦哦色天天综合| 91精品国产综合久久精品app | 日韩vs国产vs欧美| 99久久综合狠狠综合久久| 成人av资源网站| 久久久久久免费毛片精品| 亚洲午夜av在线| 成人黄色av电影| 2020国产精品自拍| 亚洲午夜视频在线| av一二三不卡影片| 久久久久久久久久久久久久久99| 亚洲乱码日产精品bd| 国产福利精品一区二区| 欧美麻豆精品久久久久久| 综合激情网...| 成人激情小说网站| 欧美成人三级在线| 亚洲一区二区三区四区五区黄| 国产高清久久久| 久久一夜天堂av一区二区三区| 亚洲妇熟xx妇色黄| 91麻豆精品在线观看| 中文字幕在线不卡视频| 国内久久婷婷综合| 久久亚洲二区三区| 日韩国产精品久久| 日韩一二三区不卡| 视频一区二区国产| 在线播放日韩导航| 亚洲五码中文字幕| 欧美日韩专区在线| 日韩理论片网站| 色视频一区二区| 亚洲美女屁股眼交| 欧美午夜一区二区三区| 亚洲美女免费在线| 欧美日韩在线观看一区二区 | 91丝袜美女网| 欧美精品一区二区久久婷婷| 国产日韩高清在线| 国产成人精品免费| 中文字幕日本不卡| 日本高清成人免费播放| 亚洲男人的天堂av| 在线看不卡av| 老司机免费视频一区二区| 欧美白人最猛性xxxxx69交| 丁香婷婷综合色啪| 国产精品嫩草影院av蜜臀| 国产成人福利片| 亚洲欧美日韩在线不卡| 欧美网站大全在线观看| 日本va欧美va欧美va精品| 精品国产乱码久久久久久影片| 国产福利电影一区二区三区| 国产精品国产a| 欧美日韩一区二区三区四区 | 日韩三级高清在线| 久久成人av少妇免费| 国产精品美女久久久久av爽李琼| aaa亚洲精品| 日韩av午夜在线观看| 欧美激情艳妇裸体舞| 欧洲视频一区二区| 久久福利视频一区二区| 国产精品家庭影院| 欧美肥妇free| 国产在线日韩欧美| 亚洲精品国产成人久久av盗摄| 精品污污网站免费看| 国产乱一区二区| 一区二区三区国产| 精品国产污污免费网站入口 | 日韩福利视频导航| 日本一区免费视频| 欧美日韩国产影片| 粉嫩蜜臀av国产精品网站| 午夜精品一区在线观看| 国产精品国产精品国产专区不片| 91成人免费电影| 日韩av一区二| 午夜精品在线看| 日韩av在线发布| 国产精品久久久久影院亚瑟| 欧美色精品在线视频| 成人午夜免费视频| 偷拍一区二区三区四区| 亚洲图片激情小说| 日韩欧美激情一区| 69久久夜色精品国产69蝌蚪网 | 亚洲va在线va天堂| 欧美男同性恋视频网站| 91在线云播放| 国产69精品久久99不卡| 日韩中文字幕91| 中文字幕一区二区三区四区不卡| 欧美xxxxx牲另类人与| 宅男在线国产精品| 一本高清dvd不卡在线观看| 成人黄色在线看| 国产99精品在线观看| 国产在线看一区| 黑人巨大精品欧美一区| 日韩激情在线观看| 日韩不卡手机在线v区| 亚洲超丰满肉感bbw| 一区二区三区 在线观看视频 | 中文字幕亚洲区| 国产精品伦理一区二区| 久久精品视频在线看| 欧美高清视频在线高清观看mv色露露十八 | 久久久久99精品国产片| 欧美一级欧美一级在线播放| 国产一区二三区好的| 久久91精品国产91久久小草| 国产欧美一区二区精品性 | 91麻豆精品国产91久久久 | 欧美色视频一区| 欧美视频一区二区| 91成人免费电影| 极品少妇xxxx精品少妇| 激情都市一区二区| 国产精品一色哟哟哟| 成人午夜视频在线观看| 99久久精品免费观看| 在线视频国内自拍亚洲视频|