IFC 4.4.0.0 build 20261005 (IFC4X4_DEV_20260525) ⚠ buildingSMART Working Draft. All content is under development.

  • Help suggest improvements
  • Get user or developer support

8.9.6.7 IfcCrossProduct

8.9.6.7.1 Semantic definition

{ .extDef}

8.9.6.7.2 Formal representation

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;

8.9.6.7.3 References

Edit on Github

3 contributor(s): ArturTomczakDion MoultbSI-Bot
Last change: Improve definition split (#876) * bring back headers headers were previously removed by mistake, now bringing them back * add new lines and rename the tag add the word 'short' in it * unify newlines make exactly one newline before and two after the tag * resolving typos Because bringing back headers required to go back in time to previous version, I'm now re-resolving the issues: #861, #860, #856 by ArturTomczak on 2024-07-16T16:07:28+02:00

Is this page difficult to understand? Let us know!

8.9.6.7.4 Changelog

8.9.6.7.4.1 IFC4

  • ,