⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qxform.c

📁 模型冲突检测
💻 C
字号:
/***************************************************************************** *    qxform.c - does xform of a vector        	Session:		    - Enter quaternion [(x, y, z), w] (no punctuation)	    - Enter vector to be xformed	    - Show quat as col matrix	    - Xform vector and print result	        rich holloway,  9/25/90	     * *****************************************************************************/#include <stdio.h>#include "quat.h"intmain(int argc, char *argv[]){    q_type	multQuat;    q_type 	xformedPoint;    q_type  	point;        double  	matrix[4][4];/* * read in, echo, and normalize 2 quaternions */printf("\nEnter xform quaternion: (vec, s) ");scanf("%lf %lf %lf %lf",     	&multQuat[0], &multQuat[1], &multQuat[2], &multQuat[3]);printf("\nEnter point: (x y z) ");scanf("%lf %lf %lf",     	&point[Q_X], &point[Q_Y], &point[Q_Z]);point[Q_W] = 0.0;/* * matrix of product quat */q_to_col_matrix(matrix, multQuat);printf("Transformation (column) matrix:\n");q_print_matrix(matrix);/*  * xformedPoint = (multQuat * candQuat) * invertedQuat	 */q_xform(xformedPoint, multQuat, point);printf("Xform Result:\n");q_print(xformedPoint);return(0);}	/* main */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -