• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ q0函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中q0函数的典型用法代码示例。如果您正苦于以下问题:C++ q0函数的具体用法?C++ q0怎么用?C++ q0使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了q0函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: max_dig_pell

//only for x^2 - 2y^2= -1;
void max_dig_pell(int num, vector<int>& vroot, vector<I64Pair>& results)
{
    results.clear();
    i64 p0(vroot[0]);
    i64 q0(1);
    i64 p1(vroot[0]*vroot[1]+1);
    i64 q1(vroot[1]);
    i64 p2(1);
    i64 q2(1);
    results.push_back(I64Pair(p0,q0));

    vroot.erase(vroot.begin());
    int vsize = vroot.size();
    //int r = vsize - 1;
    int start = 2;
    for(int s = start; true; ++s){
        int idx = (s-1)%vsize;
        int value = vroot[idx];
        p2 = p1*(value) + p0;
        q2 = q1*(value) + q0;
        p0 = p1; q0 = q1; 
        p1 = p2; q1 = q2;
        if(p2 > 1e18) break;
        if((s)%(2) == 0) {
            assert(p1*p1-5*q1*q1==-1);
            results.push_back(I64Pair(p1, q1));
        }
    }
}
开发者ID:lld2006,项目名称:my-c---practice-project,代码行数:30,代码来源:138.cpp


示例2: p0

vector<double> CIEColor::SinglehueSequential(double t, double s, double b, double c, double h)
{
	int N=10;
	vector<double> Pseg;
	vector<double> p0(3,0),p1(3,0), p2(3,0), q0(3,0), q1(3,0), q2(3,0);
		
	p2[0]=100, p2[1]=0, p2[2]=h;
	p1=dividingLCHuvforMSC_H(0,100,h);
	p0[0]=0, p0[1]=0, p0[2]=h;

	q0[0] = (1-s) * p0[0] + s *p1[0];
	q0[1] = (1-s) * p0[1] + s *p1[1];
	q0[2] = (1-s) * p0[2] + s *p1[2];

	q2[0] = (1-s) * p2[0] + s *p1[0];
	q2[1] = (1-s) * p2[1] + s *p1[1];
	q2[2] = (1-s) * p2[2] + s *p1[2];

	q1[0] = (q0[0] + q2[0])/2;
	q1[1] = (q0[1] + q2[1])/2;
	q1[2] = (q0[2] + q2[2])/2;

	vector<double> T = getT(p0, p1, p2, q0, q1, q2, 125-125*pow(0.2,(1-c)*b+t*c)); 
	Pseg = getCseg(p0, p1, p2, q0, q1, q2, T[0]);
	Pseg[2]=h;
	double r, g, k;
	//LCHuvtoRGB(Pseg[0], Pseg[1], Pseg[2], r, g, k);
	closestLCHuvtoRGB(Pseg[0], Pseg[1], Pseg[2], r, g, k);
	Pseg[0]= r, Pseg[1]=g, Pseg[2]=k;
	return Pseg;
}
开发者ID:ivcl,项目名称:SplitVectors,代码行数:31,代码来源:CIEColor_copy.cpp


示例3: bench_inter_Hor

void bench_inter_Hor()
{

   for (INT k=0; k<5000 ; k++)
   {
       Pt2dr p0 = random_pt();
       Pt2dr p1 = random_pt();
       if (std::abs(p0.y-p1.y)<1e-2)
          p1.y += 1;
       SegComp aSp(p0,p1);

       REAL anY =  NRrandom3() *100;
       Pt2dr q0 (0,anY);
       Pt2dr q1 (1,anY);

       SegComp aSq(q0,q1);

       bool OkInter;
       Pt2dr aInter0 = aSp.inter(aSq,OkInter);
       Pt2dr aInter2(aSp.AbsiceInterDroiteHoriz(anY),anY);

       REAL DH = euclid(aInter0,aInter2) ;
       BENCH_ASSERT(DH<BIG_epsilon);
   }
}
开发者ID:jakexie,项目名称:micmac,代码行数:25,代码来源:b_0_36.cpp


示例4: q2

void q2(const char *cad, int *p, int *c)
{
    if(cad[*p] == '\0')
        return;
    if(cad[*p] == 'g' || cad[*p] == 'G')
    {
        (*p)++;
        (*c)++;
        q0(cad, p, c);
    }
    else
    {
        (*p)++;
        q0(cad, p, c);
    }
}
开发者ID:mangel45,项目名称:esc,代码行数:16,代码来源:seis.c


示例5: SetWorldMatrix

    ///////////////////////////////////////////////////////////////////////////////
    //
    // Quake::SetQuake
    //
    // shake it up baby now
    //
    Bool SetWorldMatrix( FamilyNode & node, const Matrix & matrix)
    {
      ASSERT( sysInit);

      if (!*active)
      {
        // setup world position
        //
        node.SetWorldAll(matrix);

        return FALSE;
      }

      Quaternion q0( matrix);
      Quaternion q1( quakeAnim.Current().intensity * 0.2f, Vector( filterX.Current(), filterY.Current(), filterZ.Current()));
      Matrix mat( q0 * q1);
      mat.posit.x = matrix.posit.x + filterX.Current();
      mat.posit.y = matrix.posit.y + filterY.Current();
      mat.posit.z = matrix.posit.z + filterZ.Current();

      // setup world position
      //
      node.SetWorldAll(mat);

      return TRUE;
    }
开发者ID:vgck,项目名称:opendr2,代码行数:32,代码来源:environment_quake.cpp


示例6: run_multiport_test

void run_multiport_test(int num_threads) {
    typedef typename tbb::flow::multifunction_node<InputType, OutputTuple> mo_node_type;
    typedef typename std::tuple_element<0,OutputTuple>::type EvenType;
    typedef typename std::tuple_element<1,OutputTuple>::type OddType;
    tbb::task_scheduler_init init(num_threads);
    tbb::flow::graph g;
    mo_node_type mo_node(g, tbb::flow::unlimited, oddEvenBody<InputType, OutputTuple>() );

    tbb::flow::queue_node<EvenType> q0(g);
    tbb::flow::queue_node<OddType> q1(g);

    tbb::flow::make_edge(tbb::flow::output_port<0>(mo_node), q0);
    tbb::flow::make_edge(tbb::flow::output_port<1>(mo_node), q1);

    for(InputType i = 0; i < N; ++i) {
        mo_node.try_put(i);
    }

    g.wait_for_all();
    for(int i = 0; i < N/2; ++i) {
        EvenType e;
        OddType o;
        ASSERT(q0.try_get(e) && (int)e % 2 == 0, NULL);
        ASSERT(q1.try_get(o) && (int)o % 2 == 1, NULL);
    }
}
开发者ID:RandomDeveloperM,项目名称:UE4_Hairworks,代码行数:26,代码来源:test_multifunction_node.cpp


示例7: q0

void Database::CreateDefaultSqlPlaylists()
{
	QSqlQuery q0("", db);
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("The Best"));
	q0.bindValue(":dat", "SongRating > 40");
	q0.exec();
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("Good music"));
	q0.bindValue(":dat", "SongRating > 20");
	q0.exec();
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("Unrated"));
	q0.bindValue(":dat", "SongRating = 0");
	q0.exec();
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("Added today"));
	q0.bindValue(":dat", "(julianday('now') - julianday(Date, 'utc')) < 1");
	q0.exec();
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("Added this week"));
	q0.bindValue(":dat", "(julianday('now') - julianday(Date, 'utc')) <= 7");
	q0.exec();
	q0.prepare("insert into SQLPlaylist (value, data) values (:val, :dat)");
	q0.bindValue(":val", tr("Added this month"));
	q0.bindValue(":dat", "(julianday('now') - julianday(Date, 'utc')) <= 30");
	q0.exec();
	CreateDefaultSqlPlaylists2();
}
开发者ID:sushantg11,项目名称:cuberok,代码行数:29,代码来源:database.cpp


示例8: initAutomata

void initAutomata(const char *cad, int *p, int *c)
{
    *c = 0;
    if(*p < strlen(cad))
        q0(cad, p, c);
    fprintf(stdout, "La cadena \"ing\" fue encontrada %d veces\n", *c);

    inicializar();
    colorearPantalla();
    tituloVentana();

    estadoCualquiera(120.0, 250.0, "q0");
    estadoCualquiera(270.0, 250.0, "q1");
    estadoCualquiera(420.0, 250.0, "q2");
    estadoFinal(570.0, 250.0, "q3");
    grafoDirigido(120.0+40.0, 250.0, 270.0-40.0, 250.0, 1, "i");
    grafoDirigido(270.0+40.0, 250.0, 420.0-40.0, 250.0, 1, "n");
    grafoDirigido(420.0+40.0, 250.0, 570.0-40.0, 250.0, 1, "g");
    grafoDirigido(270.0, 250.0-40.0, 0.0, 0.0, 0, "i");
    grafoDirigido(110.0+40.0, 250.0+30, 280.0-40.0, 250.0+30, -1, "E-n");
    grafoDirigido(110.0+40.0, 190.0+30, 420.0-40.0, 190.0+30, -1, "E-n-g");

    al_flip_display();

    while(1)
    {
        al_wait_for_event(queue_evento, &evento);
        if(evento.type == ALLEGRO_EVENT_DISPLAY_CLOSE)
            break;
    }

    about();
    finalizar();
}
开发者ID:mangel45,项目名称:esc,代码行数:34,代码来源:seis.c


示例9: Test

void Test() {
  std::string str('x', 4);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructor parameters are probably swapped [misc-string-constructor]
  std::wstring wstr(L'x', 4);
  // CHECK-MESSAGES: [[@LINE-1]]:16: warning: constructor parameters are probably swapped
  std::string s0(0, 'x');
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructor creating an empty string
  std::string s1(-4, 'x');
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: negative value used as length parameter
  std::string s2(0x1000000, 'x');
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: suspicious large length parameter
  
  std::string q0("test", 0);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: constructor creating an empty string
  std::string q1(kText, -4);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: negative value used as length parameter
  std::string q2("test", 200);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
  std::string q3(kText, 200);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
  std::string q4(kText2, 200);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: length is bigger then string literal size
  std::string q5(kText3,  0x1000000);
  // CHECK-MESSAGES: [[@LINE-1]]:15: warning: suspicious large length parameter
}
开发者ID:falho,项目名称:clang-tools-extra,代码行数:25,代码来源:misc-string-constructor.cpp


示例10: q0

/// rearrange the quadrants of Fourier image  so that the origin is at the image center
void frequency_domain::shift( cv::Mat& image )
{
    if( image.rows == 1 && image.cols == 1)
    {
        return;
    }

    cv::vector< cv::Mat > planes;
    cv::split( image, planes );

    int xMid = image.cols >> 1;
    int yMid = image.rows >> 1;

    for( unsigned int i = 0; i < planes.size(); i++ )
    {
        cv::Mat tmp;
        cv::Mat q0(planes[i], cv::Rect(0,    0,    xMid, yMid));
        cv::Mat q1(planes[i], cv::Rect(xMid, 0,    xMid, yMid));
        cv::Mat q2(planes[i], cv::Rect(0,    yMid, xMid, yMid));
        cv::Mat q3(planes[i], cv::Rect(xMid, yMid, xMid, yMid));

        q0.copyTo(tmp);
        q3.copyTo(q0);
        tmp.copyTo(q3);

        q1.copyTo(tmp);
        q2.copyTo(q1);
        tmp.copyTo(q2);
    }

    cv::merge( planes, image );

}
开发者ID:ahmmedshakil,项目名称:snark,代码行数:34,代码来源:frequency_domain.cpp


示例11: q0

void MSNewton::Fixed::submit_constraints(const NewtonJoint* joint, dgFloat32 timestep, int thread_index) {
	JointData* joint_data = (JointData*)NewtonJointGetUserData(joint);

	// Calculate position of pivot points and Jacobian direction vectors in global space.
	dMatrix matrix0, matrix1, matrix2;
	MSNewton::Joint::c_calculate_global_matrix(joint_data, matrix0, matrix1, matrix2);

	const dVector& p0 = matrix0.m_posit;
	const dVector& p1 = matrix1.m_posit;
	// Get a point along the pin axis at some reasonable large distance from the pivot.
	dVector q0(p0 + matrix0.m_right.Scale(MIN_JOINT_PIN_LENGTH));
	dVector q1(p1 + matrix1.m_right.Scale(MIN_JOINT_PIN_LENGTH));
	// Get the ankle point.
	dVector r0(p0 + matrix0.m_front.Scale(MIN_JOINT_PIN_LENGTH));
	dVector r1(p1 + matrix1.m_front.Scale(MIN_JOINT_PIN_LENGTH));

	// Restrict movement on the pivot point along all three orthonormal directions
	NewtonUserJointAddLinearRow(joint, &p0[0], &p1[0], &matrix0.m_front[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);

	NewtonUserJointAddLinearRow(joint, &p0[0], &p1[0], &matrix0.m_up[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);

	NewtonUserJointAddLinearRow(joint, &p0[0], &p1[0], &matrix0.m_right[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);

	// Restrict rotation along all three orthonormal directions
	NewtonUserJointAddLinearRow(joint, &q0[0], &q1[0], &matrix0.m_front[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);

	NewtonUserJointAddLinearRow(joint, &q0[0], &q1[0], &matrix0.m_up[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);

	NewtonUserJointAddLinearRow(joint, &r0[0], &r1[0], &matrix0.m_up[0]);
	if (joint_data->ctype == CT_FLEXIBLE)
		NewtonUserJointSetRowSpringDamperAcceleration(joint, Joint::LINEAR_STIFF, Joint::LINEAR_DAMP);
	else if (joint_data->ctype == CT_ROBUST)
		NewtonUserJointSetRowAcceleration(joint, NewtonUserCalculateRowZeroAccelaration(joint));
	NewtonUserJointSetRowStiffness(joint, joint_data->stiffness);
}
开发者ID:chegarty3,项目名称:MSPhysics,代码行数:60,代码来源:msp_joint_fixed.cpp


示例12: q0

dFloat dMeshNodeInfo::RayCast (const dVector& p0, const dVector& p1) const
{
	dVector q0 (m_matrix.UntransformVector(p0));
	dVector q1 (m_matrix.UntransformVector(p1));

	//	int vertexCount = NewtonMeshGetVertexCount(m_mesh);
	int strideInBytes = NewtonMeshGetVertexStrideInByte(m_mesh);
	float* const vertexList = NewtonMeshGetVertexArray(m_mesh);
	dFloat t = 1.2f;
int xxx = 0;
int xxx2 = 0;
	for (void* face = NewtonMeshGetFirstFace (m_mesh); face; face = NewtonMeshGetNextFace (m_mesh, face)) {
		if (!NewtonMeshIsFaceOpen (m_mesh, face)) {

xxx ++;
			int indices[1024];
			int vertexCount = NewtonMeshGetFaceIndexCount (m_mesh, face);
			NewtonMeshGetFaceIndices (m_mesh, face, indices);

			dFloat t1 = dPolygonRayCast (q0, q1, vertexCount, vertexList, strideInBytes, indices);
			if (t1 < t) {
xxx2 = xxx;
if (xxx2 == 40276)
xxx2 = xxx;
				t = t1;		
			}
		}
	}
	return t;
}
开发者ID:ak4hige,项目名称:myway3d,代码行数:30,代码来源:dMeshNodeInfo.cpp


示例13: SubmitConstraints

	void SubmitConstraints(dFloat timestep, int threadIndex)
	{
		CustomBallAndSocket::SubmitConstraints(timestep, threadIndex);
		float invTimestep = 1.0f / timestep;

		dMatrix matrix0;
		dMatrix matrix1;

		CalculateGlobalMatrix(matrix0, matrix1);

		if (m_anim_speed != 0.0f) // some animation to illustrate purpose
		{
			m_anim_time += timestep * m_anim_speed;
			float a0 = sin(m_anim_time);
			float a1 = m_anim_offset * 3.14f;
			dVector axis(sin(a1), 0.0f, cos(a1));
			//dVector axis (1,0,0);
			m_target = dQuaternion(axis, a0 * 0.5f);
		}

		// measure error
		dQuaternion q0(matrix0);
		dQuaternion q1(matrix1);
		dQuaternion qt0 = m_target * q1;
		dQuaternion qErr = ((q0.DotProduct(qt0) < 0.0f)	? dQuaternion(-q0.m_q0, q0.m_q1, q0.m_q2, q0.m_q3) : dQuaternion(q0.m_q0, -q0.m_q1, -q0.m_q2, -q0.m_q3)) * qt0;

		float errorAngle = 2.0f * acos(dMax(-1.0f, dMin(1.0f, qErr.m_q0)));
		dVector errorAngVel(0, 0, 0);

		dMatrix basis;
		if (errorAngle > 1.0e-10f) {
			dVector errorAxis(qErr.m_q1, qErr.m_q2, qErr.m_q3, 0.0f);
			errorAxis = errorAxis.Scale(1.0f / dSqrt(errorAxis % errorAxis));
			errorAngVel = errorAxis.Scale(errorAngle * invTimestep);

			basis = dGrammSchmidt(errorAxis);
		} else {
			basis = dMatrix(qt0, dVector(0.0f, 0.0f, 0.0f, 1.0f));
		}

		dVector angVel0, angVel1;
		NewtonBodyGetOmega(m_body0, (float*)&angVel0);
		NewtonBodyGetOmega(m_body1, (float*)&angVel1);

		dVector angAcc = (errorAngVel.Scale(m_reduceError) - (angVel0 - angVel1)).Scale(invTimestep);

		// motor
		for (int n = 0; n < 3; n++) {
			// calculate the desired acceleration
			dVector &axis = basis[n];
			float relAccel = angAcc % axis;

			NewtonUserJointAddAngularRow(m_joint, 0.0f, &axis[0]);
			NewtonUserJointSetRowAcceleration(m_joint, relAccel);
			NewtonUserJointSetRowMinimumFriction(m_joint, -m_angularFriction);
			NewtonUserJointSetRowMaximumFriction(m_joint, m_angularFriction);
			NewtonUserJointSetRowStiffness(m_joint, m_stiffness);
		}
	}
开发者ID:leegoonz,项目名称:newton-dynamics,代码行数:59,代码来源:StandardJoints.cpp


示例14: angle

dgUnsigned32 dgHingeConstraint::JacobianDerivative (dgContraintDescritor& params)
{
	dgMatrix matrix0;
	dgMatrix matrix1;
	dgVector angle (CalculateGlobalMatrixAndAngle (matrix0, matrix1));

	m_angle = -angle.m_x;

	dgAssert (dgAbsf (1.0f - (matrix0.m_front % matrix0.m_front)) < dgFloat32 (1.0e-5f)); 
	dgAssert (dgAbsf (1.0f - (matrix0.m_up % matrix0.m_up)) < dgFloat32 (1.0e-5f)); 
	dgAssert (dgAbsf (1.0f - (matrix0.m_right % matrix0.m_right)) < dgFloat32 (1.0e-5f)); 

	const dgVector& dir0 = matrix0.m_front;
	const dgVector& dir1 = matrix0.m_up;
	const dgVector& dir2 = matrix0.m_right;

	const dgVector& p0 = matrix0.m_posit;
	const dgVector& p1 = matrix1.m_posit;
	dgVector q0 (p0 + matrix0.m_front.Scale3(MIN_JOINT_PIN_LENGTH));
	dgVector q1 (p1 + matrix1.m_front.Scale3(MIN_JOINT_PIN_LENGTH));

//	dgAssert (((p1 - p0) % (p1 - p0)) < 1.0e-2f);

	dgPointParam pointDataP;
	dgPointParam pointDataQ;
	InitPointParam (pointDataP, m_stiffness, p0, p1);
	InitPointParam (pointDataQ, m_stiffness, q0, q1);

	CalculatePointDerivative (0, params, dir0, pointDataP, &m_jointForce[0]); 
	CalculatePointDerivative (1, params, dir1, pointDataP, &m_jointForce[1]); 
	CalculatePointDerivative (2, params, dir2, pointDataP, &m_jointForce[2]); 
	CalculatePointDerivative (3, params, dir1, pointDataQ, &m_jointForce[3]); 
	CalculatePointDerivative (4, params, dir2, pointDataQ, &m_jointForce[4]); 

	dgInt32 ret = 5;
	if (m_jointAccelFnt) {
		dgJointCallbackParam axisParam;
		axisParam.m_accel = dgFloat32 (0.0f);
		axisParam.m_timestep = params.m_timestep;
		axisParam.m_minFriction = DG_MIN_BOUND;
		axisParam.m_maxFriction = DG_MAX_BOUND;

		if (m_jointAccelFnt (*this, &axisParam)) {
			if ((axisParam.m_minFriction > DG_MIN_BOUND) || (axisParam.m_maxFriction < DG_MAX_BOUND)) {
				params.m_forceBounds[5].m_low = axisParam.m_minFriction;
				params.m_forceBounds[5].m_upper = axisParam.m_maxFriction;
				params.m_forceBounds[5].m_normalIndex = DG_BILATERAL_FRICTION_CONSTRAINT;
			}

			CalculateAngularDerivative (5, params, dir0, m_stiffness, dgFloat32 (0.0f), &m_jointForce[5]);
//			params.m_jointAccel[5] = axisParam.m_accel;
			SetMotorAcceleration (5, axisParam.m_accel, params);
			ret = 6;
		}
	}

	return dgUnsigned32 (ret);
}
开发者ID:Hurleyworks,项目名称:MiniNewton,代码行数:58,代码来源:dgHingeConstraint.cpp


示例15: initAutomata

void initAutomata(char *cad, int *p)
{
	if(*p < strlen(cad))
		if(cad[0] == '0')
			q0(cad, p);
		else
			fprintf(stderr, "Cadena no aceptada\n");
	exit(1);
}
开发者ID:carlostule,项目名称:ESCOM,代码行数:9,代码来源:quince.c


示例16: rect

ofRectangle ofxSymbolInstance::getBoundingBox(ofMatrix4x4 mat) {
//    cout << "bounding box" << endl;
    ofRectangle rect(0,0,0,0);
    mat.preMult(this->mat);
    
    switch (type) {
        case BITMAP_INSTANCE: {
            ofVec2f p0 = mat.preMult(ofVec3f(0,0,0));
            ofVec2f p1 = mat.preMult(ofVec3f(bitmapItem->getWidth(),bitmapItem->getHeight()));
            rect = ofRectangle(p0.x,p0.y,p1.x-p0.x,p1.y-p0.y);
        } break;
            
        case SYMBOL_INSTANCE: {
            
            for (vector<layer>::iterator liter=layers.begin();liter!=layers.end();liter++) {
                frame &f = liter->frames[liter->currentFrame];
                
                vector<ofxSymbolInstance>::iterator iter=f.instances.begin();
                while (iter!=f.instances.end()) {
                    rect = iter->getBoundingBox(mat);
                    iter++;
                    if (rect.width!=0 || rect.height!=0) {
                        break;
                    }
                }
                
                while (iter!=f.instances.end()) {
                    
                    ofRectangle iterect = iter->getBoundingBox();
                    if (iterect.width!=0 || iterect.height!=0) {
                    
                        ofVec2f p0(rect.x,rect.y);
                        ofVec2f p1(p0.x+rect.width,p0.y+rect.height);
                        
                        ofVec2f q0(iterect.x,iterect.y);
                        ofVec2f q1(q0.x+iterect.width,q0.y+iterect.height);
                        
                        ofVec2f pos(MIN(p0.x,q0.x),MIN(p0.y,q0.y));
                        rect = ofRectangle(pos.x,pos.y,MAX(p1.x,q1.x)-pos.x,MAX(p1.y,q1.y)-pos.y);
                            
                       
                            //                    cout << rect.x << "\t" << rect.y << "\t" << rect.width << "\t" << rect.height << endl;
                            
                    }
                    iter++;
                   
                }
            }
        } break;
            
        default:
            break;
    } 
    
        
    return rect;
}
开发者ID:roikr,项目名称:openFrameworks007,代码行数:57,代码来源:ofxFlash.cpp


示例17: fftShift

void fftShift(cv::InputOutputArray _out)
{
    cv::Mat out = _out.getMat();

    if(out.rows == 1 && out.cols == 1)
    {
        // trivially shifted.
        return;
    }

    std::vector<cv::Mat> planes;
    planes.push_back(out);

    int xMid = out.cols >> 1;
    int yMid = out.rows >> 1;

    bool is_1d = xMid == 0 || yMid == 0;

    if(is_1d)
    {
        xMid = xMid + yMid;

        for(size_t i = 0; i < planes.size(); i++)
        {
            Mat tmp;
            Mat half0(planes[i], Rect(0, 0, xMid, 1));
            Mat half1(planes[i], Rect(xMid, 0, xMid, 1));

            half0.copyTo(tmp);
            half1.copyTo(half0);
            tmp.copyTo(half1);
        }
    }
    else
    {
        for(size_t i = 0; i < planes.size(); i++)
        {
            // perform quadrant swaps...
            Mat tmp;
            Mat q0(planes[i], Rect(0,    0,    xMid, yMid));
            Mat q1(planes[i], Rect(xMid, 0,    xMid, yMid));
            Mat q2(planes[i], Rect(0,    yMid, xMid, yMid));
            Mat q3(planes[i], Rect(xMid, yMid, xMid, yMid));

            q0.copyTo(tmp);
            q3.copyTo(q0);
            tmp.copyTo(q3);

            q1.copyTo(tmp);
            q2.copyTo(q1);
            tmp.copyTo(q2);
        }
    }

    merge(planes, out);
}
开发者ID:jakobwilm,项目名称:slstudio,代码行数:56,代码来源:phasecorr.cpp


示例18: q3

void q3(char *cad, int *p)
{
	fprintf(stdout, "Q3 cad[%d] - %s\n", *p, cad);
	(*p)--;
	if(cad[*p] == '0')
		q0(cad, p);
	else if(cad[*p] == 'X' || cad[*p] == 'Y' || cad[*p] == '1')
		q3(cad, p);
	else
		q4(cad, p);
}
开发者ID:carlostule,项目名称:ESCOM,代码行数:11,代码来源:quince.c


示例19: fftShift

//from phasecorr.cpp within opencv library code
void fftShift(cv::Mat& out)
{
    if(out.rows == 1 && out.cols == 1)
    {
        // trivially shifted.
        return;
    }

    std::vector<cv::Mat> planes;
    cv::split(out, planes);

    int xMid = out.cols >> 1;
    int yMid = out.rows >> 1;

    bool is_1d = xMid == 0 || yMid == 0;

    if(is_1d)
    {
        xMid = xMid + yMid;

        for(size_t i = 0; i < planes.size(); i++)
        {
            cv::Mat tmp;
            cv::Mat half0(planes[i], cv::Rect(0, 0, xMid, 1));
            cv::Mat half1(planes[i], cv::Rect(xMid, 0, xMid, 1));

            half0.copyTo(tmp);
            half1.copyTo(half0);
            tmp.copyTo(half1);
        }
    }
    else
    {
        for(size_t i = 0; i < planes.size(); i++)
        {
            // perform quadrant swaps...
            cv::Mat tmp;
            cv::Mat q0(planes[i], cv::Rect(0,    0,    xMid, yMid));
            cv::Mat q1(planes[i], cv::Rect(xMid, 0,    xMid, yMid));
            cv::Mat q2(planes[i], cv::Rect(0,    yMid, xMid, yMid));
            cv::Mat q3(planes[i], cv::Rect(xMid, yMid, xMid, yMid));

            q0.copyTo(tmp);
            q3.copyTo(q0);
            tmp.copyTo(q3);

            q1.copyTo(tmp);
            q2.copyTo(q1);
            tmp.copyTo(q2);
        }
    }

    cv::merge(planes, out);
}
开发者ID:dguerra,项目名称:pdmaster,代码行数:55,代码来源:ToolBox.cpp


示例20: q0

void SPCtrlCurve::setCoords( gdouble x0, gdouble y0, gdouble x1, gdouble y1,
                             gdouble x2, gdouble y2, gdouble x3, gdouble y3 )
{

    Geom::Point q0( x0, y0 );
    Geom::Point q1( x1, y1 );
    Geom::Point q2( x2, y2 );
    Geom::Point q3( x3, y3 );

    setCoords( q0, q1, q2, q3 );

}
开发者ID:AakashDabas,项目名称:inkscape,代码行数:12,代码来源:sp-ctrlcurve.cpp



注:本文中的q0函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ q1函数代码示例发布时间:2022-05-30
下一篇:
C++ q函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap