zoukankan      html  css  js  c++  java
  • IfcCrossProduct

    函数定义

    注:定义符合ISO/CD 10303-42:1992
    此函数返回两个输入方向的向量(或交叉)积。输入方向必须是三维的。结果总是一个无单位的向量。如果输入方向是平行或反平行的,则返回一个零大小的向量。
    注:功能改编自ISO 10303-42中定义的交叉产品。
    IFC1.5中增加的新函数

    EXPRESS Specification

    FUNCTION IfcCrossProduct
      (Arg1, Arg2 : IfcDirection) 
        : IfcVector;
    LOCAL
      Mag : REAL;
      Res : IfcDirection;
      V1,V2  : LIST[3:3] OF REAL;
      Result : IfcVector;
    END_LOCAL;
    
      IF (NOT EXISTS (Arg1) OR (Arg1.Dim = 2)) OR (NOT EXISTS (Arg2) OR (Arg2.Dim = 2)) THEN
        RETURN(?);
      ELSE
        BEGIN
          V1  := IfcNormalise(Arg1)IfcDirection.DirectionRatios; 
          V2  := IfcNormalise(Arg2)IfcDirection.DirectionRatios;
          Res := IfcRepresentationItem() || IfcGeometricRepresentationItem () 
                 || IfcDirection([(V1[2]*V2[3] - V1[3]*V2[2]), (V1[3]*V2[1] - V1[1]*V2[3]), (V1[1]*V2[2] - V1[2]*V2[1])]);
          Mag := 0.0;
          REPEAT i := 1 TO 3;
            Mag := Mag + Res.DirectionRatios[i]*Res.DirectionRatios[i];
          END_REPEAT;
          IF (Mag > 0.0) THEN
            Result := IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcVector(Res, SQRT(Mag));
          ELSE
            Result := IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcVector(Arg1, 0.0);
          END_IF;
          RETURN(Result);
        END;
      END_IF; 
    END_FUNCTION;
    QQ 3087438119
  • 相关阅读:
    数学符号表
    对比深度学习十大框架:TensorFlow最流行但并不是最好
    支持向量机通俗导论(理解SVM的三层境界)
    Annotation
    Struts2的拦截器
    DLL文件的引用
    JS引擎
    Windows窗口的创建
    解决构造器多参数的设计问题
    静态工厂对比构造器之优缺点
  • 原文地址:https://www.cnblogs.com/herd/p/14426743.html
Copyright © 2011-2022 走看看