hexagon logo

Cross product : some examples of use...

The cross product in the tool box is not the "real" cross product. The length result, in PC-DMIS, must be 1. If you want to use it in a test, you must modify it.
Check parallelism between 2 planes (or 2 vectors) :
F1 =GENERIC/PLANE,DEPENDENT,CARTESIAN,$
NOM/XYZ,<0,0,0>,$
MEAS/XYZ,<0,0,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
F2 =GENERIC/PLANE,DEPENDENT,CARTESIAN,$
NOM/XYZ,<0,0,2>,$
MEAS/XYZ,<0,0,2>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
ASSIGN/CROSS_ONLY=CROSS(F1.IJK,F2.IJK)*SIN(DEG2RAD(ANGLEBETWEEN(F1.IJK,F2.IJK)))
IF/CROSS_ONLY==(MPOINT(0,0,0))
COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
F1 and F2 are parallel
END_IF/
ELSE/
COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
F1 and F2 aren't parallel
END_ELSE/


You can also check if 3 points are aligned :
F4 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<0,0,0>,$
MEAS/XYZ,<0,0,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
F5 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<-1,1,0>,$
MEAS/XYZ,<-1,1,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
F6 =GENERIC/POINT,DEPENDENT,CARTESIAN,$
NOM/XYZ,<1,0,0>,$
MEAS/XYZ,<1,0,0>,$
NOM/IJK,<0,0,1>,$
MEAS/IJK,<0,0,1>
ASSIGN/V1=F5.XYZ-F4.XYZ
ASSIGN/V2=F6.XYZ-F4.XYZ
ASSIGN/P_VECT=CROSS(V1,V2)*SQRT(DOT(V1,V1))*SQRT(DOT(V2,V2))*SIN(DEG2RAD(ANGLEBETWEEN(V1,V2)))
IF/P_VECT==(MPOINT(0,0,0))
COMMENT/OPER,NO,FULL SCREEN=NO,AUTO-CONTINUE=NO,
Points are aligned
END_IF/


If points are not aligned, you can calculate the surface of triangle constructed from 3 points :
ASSIGN/P_VECT=CROSS(V1,V2)*SQRT(DOT(V1,V1))*SQRT(DOT(V2,V2))*SIN(DEG2RAD(ANGLEBETWEEN(V1,V2)))
ASSIGN/SURFACE=SQRT(DOT(P_VECT,P_VECT))/2


I'm not sure that it's very usefull, I just had to use it once !