DMIS标准中向量变量的用法如下,数据结果可以参考图片中结果,使用RationalDMIS软件来演示;
DECL/COMMON,VECTOR,ORG_CIR1_VX
KNPTR1 = OBTAIN/D(ORG_CIR1),5
KNPTR2 = OBTAIN/D(ORG_CIR1),6
KNPTR3 = OBTAIN/D(ORG_CIR1),7
ORG_CIR1_VX = ASSIGN/VCART(KNPTR1,KNPTR2,KNPTR3)
DECL/COMMON,VECTOR,ORG_CIR1_VY
KNPTR1 = OBTAIN/D(ORG_CIR1),8
KNPTR2 = OBTAIN/D(ORG_CIR1),9
KNPTR3 = OBTAIN/D(ORG_CIR1),10
ORG_CIR1_VY = ASSIGN/VCART(KNPTR1,KNPTR2,KNPTR3)
DECL/COMMON,VECTOR,ORG_CIR1_VZ
KNPTR1 = OBTAIN/D(ORG_CIR1),11
KNPTR2 = OBTAIN/D(ORG_CIR1),12
KNPTR3 = OBTAIN/D(ORG_CIR1),13
ORG_CIR1_VZ = ASSIGN/VCART(KNPTR1,KNPTR2,KNPTR3)
DECL/VECTOR,pnt
pnt=ASSIGN/VCART(8,9,10)
DECL/DOUBLE,GOTOX,GOTOY,GOTOZ
GOTOX = ASSIGN/ VECX(pnt)
GOTOY = ASSIGN/ VECY(pnt)
GOTOZ = ASSIGN/ VECZ(pnt)
GOTO/GOTOX,GOTOY,GOTOZ
向量点积就是各分量分别相乘相加,如下就是1*0+1*1+1*1=2
向量叉积计算公式如下:
$$ 设a=(X1,Y1,Z1),b=(X2,Y2,Z2) a×b=(Y1Z2-Y2Z1,Z1X2-Z2X1,X1Y2-X2Y1)
DECL/DOUBLE,VictorDot
DECL/VECTOR,XA,YA
XA = ASSIGN/ VCART(1,1,1)
YA = ASSIGN/ VCART(0,1,1)
VictorDot = ASSIGN/ VDOT(XA,YA)
DECL/VECTOR,VictorCross
VictorCross = ASSIGN/ VCROSS(XA,YA)
DECL/Vector,VictorUnit
VictorUnit = ASSIGN/ VUNIT(pnt)
计算方法就是各分量平方相加再开根号
DECL/DOUBLE,VictorMagnitude
VictorMagnitude = ASSIGN/ VMAG(pnt)
DECL/VECTOR, VictorMCS
VictorMCS = ASSIGN/ VMCS(pnt)
DECL/VECTOR, VictorPCS
VictorPCS = ASSIGN/ VPCS(VictorMCS)
DECL/VECTOR,VictorPOL
VictorPOL = ASSIGN/ VPOL(10,90*3.141592/180,5)
---------------------
版权声明:本文为傅海鑫原创文章