Function Semantic Definition
Definition from ISO/CD 10303-42:1992: This function returns the vector that is the scalar multiple of the input vector. It accepts as input a scalar and a 'vector' which may be either a Direction or a Vector. The output is a Vector of the same units as the input vector or unitless if a direction is input. If either input argument is undefined then the returned vector is also undefined.

NOTE Corresponding STEP function scalar_times_vector, new function in IFC Release 1.5. Please refer to ISO/IS 10303-42:1994, p. 107 for the final definition of the formal standard.

EXPRESS specification:

FUNCTION IfcScalarTimesVector
  (Scalar : REAL; Vec : IfcVectorOrDirection)
    : IfcVector;
  V : IfcDirection;
  Mag : REAL;
  Result : IfcVector;

    RETURN (?) ;
      V := Vec.Orientation;
      Mag := Scalar * Vec.Magnitude;
      V := Vec;
      Mag := Scalar;
    IF (Mag < 0.0 ) THEN
      REPEAT i := 1 TO SIZEOF(V.DirectionRatios);
        V.DirectionRatios[i] := -V.DirectionRatios[i];
      Mag := -Mag;
    Result := IfcRepresentationItem() || IfcGeometricRepresentationItem () || IfcVector(IfcNormalise(V), Mag);
  RETURN (Result);