您当前的位置:首页 > IT编程 > C++
| C语言 | Java | VB | VC | python | Android | TensorFlow | C++ | oracle | 学术与代码 | cnn卷积神经网络 | gnn | 图像修复 | Keras | 数据集 | Neo4j | 自然语言处理 | 深度学习 | 医学CAD | 医学影像 | 超参数 | pointnet | pytorch | 异常检测 | Transformers | 情感分类 | 知识图谱 |

自学教程:C++ rad函数代码示例

51自学网 2021-06-02 11:13:31
  C++
这篇教程C++ rad函数代码示例写得很实用,希望能帮到您。

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

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

示例1: set_high_res_screen_image_viewangle_2

void set_high_res_screen_image_viewangle_2 ( void ){	full_screen_width_view_angle = rad ( 90 );	full_screen_height_view_angle = rad ( 73.74 );}
开发者ID:Comanche93,项目名称:eech,代码行数:7,


示例2: set_high_res_screen_image_viewangle_3

void set_high_res_screen_image_viewangle_3 ( void ){	full_screen_width_view_angle = rad ( 120 );	full_screen_height_view_angle = rad ( 104.82 );}
开发者ID:Comanche93,项目名称:eech,代码行数:7,


示例3: rot

Matrix rot(Matrix a, double theta, int axis){	if(axis!=1 && axis!=2 && axis!=3){		printf("Error, axis must equal 1, 2, or 3.");		exit(EXIT_FAILURE);	}    /*left or right coordianate system??*/	double s, c;	Matrix r, rot;	r = new_matrix(4, 4);	rot = new_matrix(4, 4);		s = sin(rad(theta));	c = cos(rad(theta));	double elem1[16] = {1, 0, 0, 0, 0, c, -s, 0, 0, s, c, 0, 0, 0, 0, 1};	double elem2[16] = {c, 0, s, 0, 0, 1, 0, 0, -s, 0, c, 0, 0, 0, 0, 1};	double elem3[16] = {c, -s, 0, 0, s, c, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1};		switch(axis){	    case 1:		    rot.t = elem1;			break;		case 2:		    rot.t = elem2;			break;		case 3:		    rot.t = elem3;			break;	}	r = matrix_mult(rot, a);		return r;}
开发者ID:ThomasWilshaw,项目名称:render,代码行数:33,


示例4: set_high_res_screen_image_viewangle_1

void set_high_res_screen_image_viewangle_1 ( void ){	full_screen_width_view_angle = rad ( 59.99 );	full_screen_height_view_angle = rad ( 46.82 );}
开发者ID:Comanche93,项目名称:eech,代码行数:7,


示例5: set_high_res_screen_image_viewangle_4

void set_high_res_screen_image_viewangle_4 ( void ){	full_screen_width_view_angle = rad ( 20 );	full_screen_height_view_angle = rad ( 15.6 );}
开发者ID:Comanche93,项目名称:eech,代码行数:7,


示例6: citi_create_vector

/* Create a valid vector for the dataset. */static vector * citi_create_vector (struct citi_package_t * p, int i,				    char * n, char * type) {  vector * vec;  vec = citi_get_vector (p, i); // fetch vector  vec = new vector (*vec);      // copy vector  vec->reverse ();              // reverse vector  // convert data if necessary  if (!strcmp (type, "MAGANGLE")) {    for (int i = 0; i < vec->getSize (); i++) {      nr_complex_t val = vec->get (i);      val = polar (real (val), rad (imag (val)));      vec->set (val, i);    }  }  else if (!strcmp (type, "DBANGLE")) {    for (int i = 0; i < vec->getSize (); i++) {      nr_complex_t val = vec->get (i);      val = polar (pow (10.0, real (val) / 20.0), rad (imag (val)));      vec->set (val, i);    }  }  // return named vector  vec->setName (n);  return vec;}
开发者ID:Freecore,项目名称:qucs,代码行数:28,


示例7: main

int main(int argc, char** argv) {	long nrh, nrl, nch, ncl;	byte** I;	byte** binary;	byte** droits;	int theta, roMax, ro;	int** tableRT;	I = LoadPGM_bmatrix("route0.pgm", &nrl, &nrh, &ncl, &nch);	binary = bmatrix(nrl, nrh, ncl, nch);	roMax = sqrt(nrh * nrh + nch * nch);	tableRT = imatrix(0, 179, 0, roMax);	droits = bmatrix(0, 179, 0, roMax);	int i, j;	for (i = nrl; i < nrh; i++) {		for (j = ncl; j < nch; j++) {			if (I[i][j] >= 180)				binary[i][j] = 255;			else				binary[i][j] = 0;		}	}	for (theta = 0; theta < 180; theta++) {		for (ro = 0; ro < roMax; ro++) {			tableRT[theta][ro] = 0;		}	}	for (theta = 0; theta < 180; theta++) {		for (i = nrl; i < nrh; i++) {			for (j = ncl; j < nch; j++) {				if (I[i][j] >= 180) {					ro = i * cos(rad(theta)) + j * sin(rad(theta));					tableRT[theta][abs(ro)]++;				}			}		}	}	int max = 0;	for (theta = 0; theta < 180; theta++) {		for (ro = 0; ro < roMax; ro++) {			if (tableRT[theta][ro] > max) {				max = tableRT[theta][ro];			}		}	}	SavePGM_bmatrix(binary, nrl, nrh, ncl, nch, "route_binary.pgm");	free_bmatrix(I, nrl, nrh, ncl, nch);	free_bmatrix(binary, nrl, nrh, ncl, nch);	return 0;}
开发者ID:ghak,项目名称:M1_TSI_TP3,代码行数:58,


示例8: geodist

inline double geodist(double long1, double lat1, double long2, double lat2){    double radLat1 = rad(lat1);    double radLat2 = rad(lat2);    double a = radLat1 - radLat2;    double b = rad(long1) - rad(long2);    double s = 2 * asin(sqrt(pow(sin(a / 2), 2) + cos(radLat1) * cos(radLat2) * pow(sin(b / 2), 2)));    return s * EARTH_RADIUS * 1000.0;}
开发者ID:bruce2008github,项目名称:sf1r-ad-delivery,代码行数:9,


示例9: cos

Point MathHelper::calcEndPoint(const Point &startPoint, float angle, float length){  Point endPoint;  endPoint.setX(startPoint.x() + length * cos(rad(angle)));  endPoint.setY(startPoint.y()+ length * sin(rad(angle)));  return endPoint;}
开发者ID:Ulle84,项目名称:UllesSourceCode,代码行数:9,


示例10: resetCamera

void resetCamera() {    glMatrixMode(GL_MODELVIEW);    glLoadIdentity();    // página 19 http://professor.unisinos.br/ltonietto/jed/pgr/CameraSintetica.pdf    gluLookAt(              currentPosition.x, currentPosition.y, currentPosition.z,              currentPosition.x + cos(rad(angleH)), sin(rad(angleV)), currentPosition.z + sin(rad(angleH)),              0, 1, 0              );}
开发者ID:rafaeleyng,项目名称:unisinos,代码行数:10,


示例11: animate_havoc_external_wipers

void animate_havoc_external_wipers (object_3d_instance *inst3d){	object_3d_sub_object_search_data		search;	////////////////////////////////////////	//	// pilot's wipers	//	////////////////////////////////////////	search.search_depth = 0;	search.search_object = inst3d;	search.sub_object_index = OBJECT_3D_SUB_OBJECT_WIPER_ARM_PILOT;	if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)	{		search.result_sub_object->relative_roll = wiper_position * (rad (65.3756) / MAX_WIPER_POSITION);	}	search.search_depth = 0;	search.search_object = inst3d;	search.sub_object_index = OBJECT_3D_SUB_OBJECT_WIPER_BLADE_PILOT;	if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)	{		search.result_sub_object->relative_roll = (wiper_position * (rad (-74.7756) / MAX_WIPER_POSITION)) + rad (4.7);	}	////////////////////////////////////////	//	// co-pilot's wipers	//	////////////////////////////////////////	search.search_depth = 0;	search.search_object = inst3d;	search.sub_object_index = OBJECT_3D_SUB_OBJECT_WIPER_ARM_COPILOT;	if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)	{		search.result_sub_object->relative_roll = wiper_position * (rad (90.0) / MAX_WIPER_POSITION);	}	search.search_depth = 0;	search.search_object = inst3d;	search.sub_object_index = OBJECT_3D_SUB_OBJECT_WIPER_BLADE_COPILOT;	if (find_object_3d_sub_object (&search) == SUB_OBJECT_SEARCH_RESULT_OBJECT_FOUND)	{		search.result_sub_object->relative_roll = (wiper_position * (rad (-100.0) / MAX_WIPER_POSITION)) + rad (5.0);	}}
开发者ID:DexterWard,项目名称:comanche,代码行数:53,


示例12: update_vector_main_rotor_dynamics

void update_vector_main_rotor_dynamics (void){	float		rotor_roll,		rotor_pitch,		cyclic_x,		cyclic_y,		collective,		blade_pitch;	// calculate blade pitch 0->5 Degs. collective = blade_pitch^3	collective = current_flight_dynamics->input_data.collective.value;	blade_pitch = pow (fabs (collective), (float) (1.0 / 3.0)) * (current_flight_dynamics->main_blade_pitch.max / 4.64);	current_flight_dynamics->main_blade_pitch.value = blade_pitch;	current_flight_dynamics->main_blade_pitch.value = bound (																current_flight_dynamics->main_blade_pitch.value,																current_flight_dynamics->main_blade_pitch.min,																current_flight_dynamics->main_blade_pitch.max);	// calculate 'Tip Plane Path' roll and pitch	// roll	cyclic_x = current_flight_dynamics->input_data.cyclic_x.value;	rotor_roll = rad (cyclic_x / (current_flight_dynamics->input_data.cyclic_x.max / deg (current_flight_dynamics->main_rotor_roll_angle.max)));	current_flight_dynamics->main_rotor_roll_angle.value = rotor_roll;	current_flight_dynamics->main_rotor_roll_angle.value = bound (																current_flight_dynamics->main_rotor_roll_angle.value,																current_flight_dynamics->main_rotor_roll_angle.min,																current_flight_dynamics->main_rotor_roll_angle.max);	// pitch	cyclic_y = current_flight_dynamics->input_data.cyclic_y.value;	rotor_pitch = -rad (cyclic_y / (current_flight_dynamics->input_data.cyclic_y.max / deg (current_flight_dynamics->main_rotor_pitch_angle.max)));	current_flight_dynamics->main_rotor_pitch_angle.value = rotor_pitch;	current_flight_dynamics->main_rotor_pitch_angle.value = bound (																current_flight_dynamics->main_rotor_pitch_angle.value,																current_flight_dynamics->main_rotor_pitch_angle.min,																current_flight_dynamics->main_rotor_pitch_angle.max);}
开发者ID:Comanche93,项目名称:eech,代码行数:52,


示例13: acos

 void Plan13::footprintOctagon(float *points, float SLATin, float SLONin, float REin, float RSin) {	//static float points[16];	Serial.print("SLAT: ");	Serial.print(SLATin);	Serial.print(", SLON: ");	Serial.print(SLONin);	Serial.print(", RE: ");	Serial.print(REin);	Serial.print(", RS: ");	Serial.println(RSin);	float srad = acos(REin/RSin); // Beta in Davidoff diag. 13.2, this is in rad	Serial.print("srad: ");	Serial.println(srad);	float cla= cos(rad(SLATin));	float sla = sin(rad(SLATin));	float clo = cos(rad(SLONin));	float slo = sin(rad(SLONin));	float sra = sin(srad);	float cra = cos(srad);	for (int i = 0; i < 16; i = i +2) {		float a = 2 * M_PI * i / 16;		Serial.print("/ta: ");		Serial.println(a);		float X = cra;		Serial.print("/t first X: ");		Serial.println(X);		Serial.print("/t first Y: ");		float Y = sra*sin(a);		Serial.println(Y);		float Z = sra*cos(a);		Serial.print("/t first Z: ");		Serial.println(Z);		float x = X*cla - Z*sla;		float y = Y;		float z = X*sla + Z*cla;		X = x*clo - y*slo;		Serial.print("/tX: ");		Serial.println(X);		Y = x*slo + y*clo;		Serial.print("/tY: ");		Serial.println(Y);		Z = z; 		Serial.print("/tZ: ");		Serial.println(Z);		points[i] = deg(FNatn(Y,X));		Serial.print("/t Long: ");		Serial.print(points[i]);		points[i+1] = deg(asin(Z));		Serial.print("/t Lat: ");		Serial.println(points[i+1]);	}}
开发者ID:BackupGGCode,项目名称:qrptracker,代码行数:52,


示例14: fast_rotate_air_radar_scan_datum_right

static void fast_rotate_air_radar_scan_datum_right (void){	air_radar.scan_datum += rad (90.0);	air_radar.sweep_offset -= rad (90.0);	if (air_radar.scan_datum > rad (180.0))	{		air_radar.scan_datum -= rad (360.0);	}	limit_radar_sweep (&air_radar);}
开发者ID:Comanche93,项目名称:eech,代码行数:13,


示例15: rotate_air_radar_scan_datum_right

static void rotate_air_radar_scan_datum_right (void){	air_radar.scan_datum += APACHE_AIR_RADAR_SCAN_DATUM_ROTATE_STEP;	air_radar.sweep_offset -= APACHE_AIR_RADAR_SCAN_DATUM_ROTATE_STEP;	if (air_radar.scan_datum > rad (180.0))	{		air_radar.scan_datum -= rad (360.0);	}	limit_radar_sweep (&air_radar);}
开发者ID:Comanche93,项目名称:eech,代码行数:13,


示例16: fast_rotate_air_radar_scan_datum_left

static void fast_rotate_air_radar_scan_datum_left (void){	air_radar.scan_datum -= rad (90.0);	air_radar.sweep_offset += rad (90.0);	if (air_radar.scan_datum < rad (-180.0))	{		air_radar.scan_datum += rad (360.0);	}	limit_radar_sweep (&air_radar);}
开发者ID:Comanche93,项目名称:eech,代码行数:13,


示例17: initialise_viper_hms

void initialise_viper_hms (void){	if (get_global_simple_avionics ())	{		hms_max_visual_range		= 5000.0;		hms_max_field_of_view	= rad (45.0);	}	else	{		hms_max_visual_range		= 2500.0;		hms_max_field_of_view	= rad (45.0);	}};
开发者ID:Comanche93,项目名称:eech,代码行数:13,


示例18: getDistance

double getDistance(double dlat1,double dlng1,double dlat2,double dlng2){	double radlat1 = rad(dlat1);	double radlat2 = rad(dlat2);	double a = radlat1-radlat2;	double b = rad(dlng1)-rad(dlng2);	double s = 2*asin(sqrt(pow(sin(a/2),2) +cos(radlat1)*cos(radlat2)*pow(sin(b/2),2)));	s = s*6378.137;	s = round(s*10000)/10000;	return s;}
开发者ID:daiybh,项目名称:GPSGater,代码行数:13,


示例19: update_viper_hms

void update_viper_hms (void){	if (get_global_simple_avionics ())	{		hms_max_visual_range		= 5000.0;		hms_max_field_of_view	= rad (45.0);	}	else	{		hms_max_visual_range		= 2500.0;		hms_max_field_of_view	= rad (45.0);	}	////////////////////////////////////////	while (single_target_acquisition_system_select_next_target_key)	{		select_next_hms_target ();		single_target_acquisition_system_select_next_target_key--;	}	////////////////////////////////////////	while (single_target_acquisition_system_select_previous_target_key)	{		select_previous_hms_target ();		single_target_acquisition_system_select_previous_target_key--;	}// Jabberwock 031107 Designated targets		while (single_target_acquisition_system_select_next_designated_key)	{		select_next_designated_hms_target ();		single_target_acquisition_system_select_next_designated_key--;	}	////////////////////////////////////////	while (single_target_acquisition_system_select_previous_designated_key)	{		select_previous_designated_hms_target ();		single_target_acquisition_system_select_previous_designated_key--;	}	// Jabberwock 031107 ends	}
开发者ID:Comanche93,项目名称:eech,代码行数:51,


示例20: rad

void GLWidget::pickPoint(int mouse_x, int mouse_y, double *scene_x, double *scene_y) {  double cx = window_width / 2.0;  double cy = window_height / 2.0;  double pan = rad(-90.0 - camera_pose.pan);  double tilt = rad(90.0 - camera_pose.tilt);  double d = camera_pose.distance;  double f = cy / tan(rad(camera_fov / 2.0));  double px = (mouse_x - cx) * cos(tilt) * d / (cos(tilt) * f + sin(tilt) * mouse_y - sin(tilt) * cy);  double py = -(mouse_y - cy) * d / (cos(tilt) * f + sin(tilt) * mouse_y - sin(tilt) * cy);  // rotate by pan, add offset  *scene_x = px * cos(pan) + py * sin(pan) + camera_pose.x_offset;  *scene_y = -px * sin(pan) + py * cos(pan) + camera_pose.y_offset;}
开发者ID:Forrest-Z,项目名称:stanford_self_driving_car_code,代码行数:15,


示例21: distance

static double distance(double lat1,double lon1,double lat2,double lon2){	double dlat = fabs(rad(lat1) - rad(lat2));	double dlon = fabs(rad(lon1) - rad(lon2));	double a,c,d;	//printf("===%f,%f/n",dlat,dlon);	a = sin(dlat / 2) * sin(dlat / 2) + cos(lat1) * cos(lat2) * sin(dlon / 2) * sin(dlon / 2);	//printf("a===%f/n",a);	a=fabs(a);	c = 2 * atan2(sqrt(a), sqrt(fabs(1 - a)));	//printf("c===%f/n",c);	d = EARTH * c;	printf("%.6f/n",d);    return d;}
开发者ID:liqwalex,项目名称:testgit,代码行数:15,


示例22: getPropertyDouble

void iac::initAC (void) {  nr_double_t a = getPropertyDouble ("I");  nr_double_t p = getPropertyDouble ("Phase");  nr_complex_t i = polar (a, rad (p));  allocMatrixMNA ();  setI (NODE_1, +i); setI (NODE_2, -i);}
开发者ID:Tushar1313,项目名称:qucs_cvs,代码行数:7,


示例23: get_ballistic_weapon_drop

static float get_ballistic_weapon_drop(entity_sub_types weapon_sub_type){#define MAX_RANGE 4000.0	static float		angle_of_drop = 0.0;	float		time_of_flight,		triangulated_range,		range_diff,		height = current_flight_dynamics->radar_altitude.value,		pitch = current_flight_dynamics->pitch.value;	if (get_time_acceleration() != TIME_ACCELERATION_PAUSE)	{		if (pitch > (angle_of_drop + rad(0.05)) || height < 2.0)			triangulated_range = MAX_RANGE;		else			triangulated_range = bound(height / tan(-pitch + angle_of_drop), 0.0, MAX_RANGE);		range_diff = triangulated_range - hud_aim_range;		// move the aiming range in gradual steps, so as not to come into a oscilating		// state where it continousely overcorrects in alternating directions		hud_aim_range += 0.25 * range_diff;		if (get_ballistic_pitch_deflection(weapon_sub_type, hud_aim_range, pitch, &angle_of_drop, &time_of_flight, FALSE, TRUE))			angle_of_drop -= pitch;		else			angle_of_drop = 0.0;	}	hud_aim_range;	return angle_of_drop;}
开发者ID:Comanche93,项目名称:eech,代码行数:35,


示例24: initialise_hms_gun_pipper

static void initialise_hms_gun_pipper (void){	int		i;	float		theta,		sin_theta,		cos_theta;	theta = rad(0);	for (i = 0; i < NUM_GUN_PIPPER_POINTS; i++)	{		sin_theta = sin (theta);		cos_theta = cos (theta);		gun_pipper_points[i][0] = sin_theta * GUN_PIPPER_SIZE;		gun_pipper_points[i][1] = cos_theta * GUN_PIPPER_SIZE;		gun_pipper_points2[i][0] = sin_theta * GUN_PIPPER_SIZE2;		gun_pipper_points2[i][1] = cos_theta * GUN_PIPPER_SIZE2;		theta += GUN_PIPPER_ANGULAR_STEP_SIZE;	}}
开发者ID:Comanche93,项目名称:eech,代码行数:25,


示例25: Rchain_hand

int QilexDoc::doc_new_kinematic_hand(ct_new_kinematic_chain *data){   int error = 0;   int tipus = 0;   void * buffer ; //char *buffer;   char *buftemp = (char*)malloc(1024);   SoOutput out;   size_t sizeModel = 0;   SoSeparator *kinechain = new SoSeparator;   SoSeparator *kinetest = new SoSeparator;   Rchain_hand *kineengine = new Rchain_hand();   SoTransform *pos_rot = new SoTransform;   SbVec3f joinax;   joinax.setValue(SbVec3f(data->x,data->y,data->z));   pos_rot->translation.setValue(joinax);   pos_rot->rotation.setValue(SbVec3f(data->axeX, data->axeY, data->axeZ), (float) rad((double) data->angle));   kinechain = readFile(data->QsModelFile.latin1(), tipus);   if (kinechain == NULL) // no object read   { return 1; }   else  // ok, there's no object with the same name   {      error = kineengine->init_dat(data->QsDatFile.latin1()); //      if (error == 0)      {         kinechain->ref();         kinetest = (SoSeparator*)SoNode::getByName(data->QsName.latin1());         if (kinetest==NULL)         {            //we need to put it in a buffer to write the xml file            // if is Ok            SoOutput out;            out.setBuffer(buftemp, 1024, reallocCB);            SoWriteAction wa1(&out);            wa1.apply(kinechain);            out.getBuffer(buffer, sizeModel);            kinechain->insertChild(pos_rot, 0);         }         error = doc_insert_kinematic_hand(kineengine, kinechain);      }   }   if (error==0)   {      writeXML_kineelement((char *)buffer, sizeModel, tipus, data, kineengine);   }   return error;}
开发者ID:BackupTheBerlios,项目名称:qilex-svn,代码行数:60,


示例26: fix_position

void BallMovement::bounce(bool collision){    fix_position();    float angle = rad(instance->direction * 11.25f);    float found_a = -1.0f;    for (float a = 0.0f; a < (CHOW_PI*2.0f); a += (CHOW_PI*2.0f) / 16.0f) {        float x_move = 10.0f * cos(angle + a);        float y_move = -10.0f * sin(angle + a);        int x = instance->x + x_move;        int y = instance->y + y_move;        if (!test_position(x, y)) {            found_a = a;            break;        }    }    if (found_a == -1.0f) {        instance->set_direction((instance->direction + 16) % 32, false);        return;    }    angle += found_a * 2.0f;    if (angle > 2.0 * CHOW_PI)        angle -= 2.0 * CHOW_PI;    instance->set_direction(deg(angle) / 11.25f, false);}
开发者ID:tryzombie501,项目名称:anaconda,代码行数:30,


示例27: rad

int RadixSort::Sort(Array &array) const{	int maxRadix = 100; 	std::vector<int> rad(array.Size()); // for stroring mod	std::vector<int> tmp(array.Size()); // 	for(int m=1; m <= maxRadix; m*=10)	{		for(int i=0; i < array.Size();i++)		{			rad[i] = (array[i] / m) % 10;		}				int k = 0;		for(int i=0; i < 10; i++)		{			for(int j=0; j < array.Size(); j++)			{				if(rad[j] == i)				{					tmp[k++] = array[j]; // copy array to tmp based on 'mod'				}			}		}				for(int i=0; i< array.Size(); i++)		{			array[i] = tmp[i];   // copy tmp back to array		}		// array.Print("->");	}	return 0;}
开发者ID:jnyabe,项目名称:lang,代码行数:33,


示例28: main

int main() {    bool sieve[MAX];    memset(sieve, true, sizeof(sieve));    sieve[0] = false;    sieve[1] = false;    int prime = 2;    for (int i = 0; i * i < MAX; ++i) {        del_mult(prime, sieve);        prime = next_prime(prime, sieve);    }    std::vector<int> primes;    for (int i = 0; i < MAX; ++i) {        if (sieve[i])            primes.push_back(i);    }    std::vector<std::pair<int, int>> pairs;    for (int i = 1; i <= 100000; ++i) {        pairs.push_back(std::make_pair(i, rad(i, primes)));    }    std::sort(pairs.begin(), pairs.end(), less_than);    std::cout << pairs[9999].first << std::endl;    return 0;}
开发者ID:DavieV,项目名称:Euler,代码行数:26,


示例29: rad

void Campus::Shake(){	if (ShakeTime > 0){		ShakeTime--;		std::uniform_real_distribution<float> rad(0.0f, 1.0f);		std::mt19937 mtRand{ std::random_device()() };		ShakeVar.x = rad(mtRand)*SHAKE_POWER - SHAKE_POWER / 2;		ShakeVar.y = rad(mtRand)*SHAKE_POWER - SHAKE_POWER / 2;	}	else{		ShakeVar.x = 0;		ShakeVar.y = 0;		ShakeTime = 0;	}}
开发者ID:team-timeProjects,项目名称:kotonarinojikan,代码行数:16,


示例30: polar

void hybrid::initAC (void) {  nr_double_t  k = 2.0 * M_SQRT2;  nr_complex_t p = polar (1.0, rad (getPropertyDouble ("phi")));  nr_complex_t d = 2.0 * p * (p - 4.0) - 1.0;  nr_complex_t y;  setVoltageSources (0);  allocMatrixMNA ();  d *= getPropertyDouble ("Zref");  y = (-6.0*p*p + 8.0*p - 1.0) / d;  setY (NODE_1, NODE_1, y); setY (NODE_3, NODE_3, y);  y = (-2.0*p*p + 8.0*p - 5.0) / d;  setY (NODE_2, NODE_2, y); setY (NODE_4, NODE_4, y);  y = 2.0*k * (p * (p - 1.0) - 0.5) / d;  setY (NODE_1, NODE_3, y); setY (NODE_3, NODE_1, y);  y = k * (p - 2.0) / d;  setY (NODE_2, NODE_4, y); setY (NODE_4, NODE_2, y);  y = k * (-2.0*p + 1.0) / d;  setY (NODE_1, NODE_4, y); setY (NODE_4, NODE_1, y);  setY (NODE_2, NODE_3, y); setY (NODE_3, NODE_2, y);  y = (4.0*p + 4.0) / d;  setY (NODE_1, NODE_2, y); setY (NODE_2, NODE_1, y);  setY (NODE_3, NODE_4, y); setY (NODE_4, NODE_3, y);}
开发者ID:Mehanik,项目名称:qucs,代码行数:30,



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


C++ rad2deg函数代码示例
C++ r_type函数代码示例
万事OK自学网:51自学网_软件自学网_CAD自学网自学excel、自学PS、自学CAD、自学C语言、自学css3实例,是一个通过网络自主学习工作技能的自学平台,网友喜欢的软件自学网站。