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

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

51自学网 2021-06-03 09:36:59
  C++
这篇教程C++ vector_3函数代码示例写得很实用,希望能帮到您。

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

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

示例1: matrix_3x3

OMEGA_H_INLINE Matrix<3, 3> matrix_3x3(    Real a, Real b, Real c, Real d, Real e, Real f, Real g, Real h, Real i) {  Matrix<3, 3> o;  o[0] = vector_3(a, d, g);  o[1] = vector_3(b, e, h);  o[2] = vector_3(c, f, i);  return o;}
开发者ID:ibaned,项目名称:omega_h,代码行数:8,


示例2: apply_rotation_xyz

void apply_rotation_xyz(matrix_3x3 matrix, float& x, float& y, float& z) {  vector_3 vector = vector_3(x, y, z);  vector.apply_rotation(matrix);  x = vector.x;  y = vector.y;  z = vector.z;}
开发者ID:wizzard94,项目名称:MarlinKimbra,代码行数:7,


示例3: vector_3

matrix_3x3 matrix_3x3::create_look_at(vector_3 target){    vector_3 z_row = target.get_normal();    vector_3 x_row = vector_3(1, 0, -target.x/target.z).get_normal();    vector_3 y_row = vector_3(0, 1, -target.y/target.z).get_normal();   // x_row.debug("x_row");   // y_row.debug("y_row");   // z_row.debug("z_row");      // create the matrix already correctly transposed    matrix_3x3 rot = matrix_3x3::create_from_rows(x_row, y_row, z_row); //   rot.debug("rot");    return rot;}
开发者ID:HrRossi,项目名称:FABlin,代码行数:17,


示例4: plan_get_position

  vector_3 plan_get_position() {    vector_3 position = vector_3(st_get_position_mm(X_AXIS), st_get_position_mm(Y_AXIS), st_get_position_mm(Z_AXIS));    //position.debug("in plan_get position");    //plan_bed_level_matrix.debug("in plan_get_position");    matrix_3x3 inverse = matrix_3x3::transpose(plan_bed_level_matrix);    //inverse.debug("in plan_get inverse");    position.apply_rotation(inverse);    //position.debug("after rotation");    return position;  }
开发者ID:RuanAragao,项目名称:MarlinDev,代码行数:12,


示例5: vector_3

  /**   * Get the XYZ position of the steppers as a vector_3.   *   * On CORE machines XYZ is derived from ABC.   */  vector_3 Planner::adjusted_position() {    vector_3 pos = vector_3(stepper.get_axis_position_mm(X_AXIS), stepper.get_axis_position_mm(Y_AXIS), stepper.get_axis_position_mm(Z_AXIS));    //pos.debug("in Planner::adjusted_position");    //bed_level_matrix.debug("in Planner::adjusted_position");    matrix_3x3 inverse = matrix_3x3::transpose(bed_level_matrix);    //inverse.debug("in Planner::inverse");    pos.apply_rotation(inverse);    //pos.debug("after rotation");    return pos;  }
开发者ID:AJMartel,项目名称:Migbot-Firmware,代码行数:19,


示例6: vector_3

vector_3 vector_3::get_normal() {  vector_3 normalized = vector_3(x, y, z);  normalized.normalize();  return normalized;}
开发者ID:wizzard94,项目名称:MarlinKimbra,代码行数:5,


示例7: cross

OMEGA_H_INLINE Vector<3> cross(Vector<3> a, Vector<3> b) {  return vector_3(a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2],      a[0] * b[1] - a[1] * b[0]);}
开发者ID:ibaned,项目名称:omega_h,代码行数:4,


示例8: main

int main(){	//**************//	//** jVector2 **//	//**************//	// Create an "empty" jVector2:  (0,0)	jVector2 vector1;	// Create "partial" jVector2: (5,0)	jVector2 vector2(5.0f);	// Create "full" jVector2: (1,2)	jVector2 vector3(1.0f, 2.0f);	// print the vectors out	std::cout << vector1.toString() << std::endl;	std::cout << vector2.toString() << std::endl;	std::cout << vector3.toString() << std::endl;	// add two vectors together	jVector2 sum23 = vector2 + vector3;	std::cout << sum23.toString() << std::endl;	// subtract two vectors	jVector2 diff = jVector2(6.0f, 4.0f) - jVector2(10.0f, 2.0f);	std::cout << diff.toString() << std::endl;	// multiply vector by scalar	std::cout << (vector3 * 1.25f).toString() << std::endl;	// divide vector by scalar	std::cout << (sum23 / 10.0f).toString() << std::endl;	// test equality	std::cout << (sum23 == diff) << std::endl;	// test inequality	std::cout << (diff != vector1) << std::endl;	// get magnitude	std::cout << vector3.magnitude_sqr() << std::endl;	// normalize vector	std::cout << (vector3.normalized()).toString() << std::endl;	////////////////////////////////////////////////////	// jVector3	jVector3 vector_1;	jVector3 vector_2(5.0f);	jVector3 vector_3(1.0f, 2.0f, 3.0f);	std::cout << vector_1.toString() << std::endl;	std::cout << vector_2.toString() << std::endl;	std::cout << vector_3.toString() << std::endl;	// This will be put into the jDebug namespace/class./*	#ifdef linux	#else		// And this is why programming for Windows sucks...		HANDLE h_stdout = GetStdHandle( STD_OUTPUT_HANDLE );		CONSOLE_SCREEN_BUFFER_INFO csbi;		GetConsoleScreenBufferInfo( h_stdout, &csbi );		// Foreground B G R I		// Colors     0 0 1 1		// Background B G R I		// Colors     0 0 0 1		// All together, 00110001 is like this:		SetConsoleTextAttribute( h_stdout, 0x31 );		std::cout << vector_1 << std::endl;		SetConsoleTextAttribute( h_stdout, csbi.wAttributes );	#endif */	jDebug::LogError("An error has occurred!");	jDebug::LogWarning("A warning has occurred!");	jDebug::Log("A notification has appeared.");	jDebug::AddLogger("main", "logs/main.log");	jDebug::LogError("main", "A test error to be found in main.log");	jDebug::Log("main", "A test notification to be found in main.log");	// Don't forget your cleanup!	jDebug::DestructLoggers();	return 0;}
开发者ID:RengaJ,项目名称:jtech,代码行数:78,



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


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