FUNCTION dot_product

(* SCHEMA Ap210_electronic_assembly_interconnect_and_packaging_design_mim_lf; *)
FUNCTION dot_product
	(arg1: direction; arg2: direction) : REAL;
   LOCAL
     scalar : REAL;
     vec1, vec2: direction;
     ndim : INTEGER;
   END_LOCAL;
   
   IF NOT EXISTS (arg1) OR NOT EXISTS (arg2) THEN
     scalar := ?;
     (* When function is called with invalid data an indeterminate result
     is returned *)
   ELSE
     IF (arg1.dim <> arg2.dim) THEN
       scalar := ?;
     (* When function is called with invalid data an indeterminate result
     is returned *)
     ELSE
       BEGIN
         vec1   := normalise(arg1);
         vec2   := normalise(arg2);
         ndim   := arg1.dim;
         scalar := 0.0;
         REPEAT  i := 1 TO ndim;
           scalar := scalar +
                       vec1.direction_ratios[i]*vec2.direction_ratios[i];
         END_REPEAT;
       END;
     END_IF;
   END_IF;
   RETURN (scalar);
END_FUNCTION;

Referenced By

Defintion dot_product is references by the following definitions:
DefinitionType
 base_axis FUNCTION
 camera_model_d3 ENTITY
 extruded_area_solid ENTITY
 extruded_face_solid ENTITY
 first_proj_axis FUNCTION
 second_proj_axis FUNCTION


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2012-03-27T17:15:33-04:00