FUNCTION get_relative_direction_2points

(* SCHEMA step_merged_ap_schema; *)
-- IN AP242
FUNCTION get_relative_direction_2points
      (cp1 : cartesian_point;
       cp2 : cartesian_point ) : direction;
   LOCAL
      d1 : REAL;
      d2 : REAL;
      d3 : REAL;
      magnitude : REAL;
      result : direction := ?;
   END_LOCAL;
      IF (cp1.dim <> 3) OR (cp2.dim <> 3) THEN
         RETURN (result);
      ELSE
         BEGIN
            d1 := cp2.coordinates[1] - cp1.coordinates[1];
            d2 := cp2.coordinates[2] - cp1.coordinates[2];
            d3 := cp2.coordinates[3] - cp1.coordinates[3];
            magnitude := SQRT(d1 * d1 + d2 * d2 + d3 * d3);
            IF magnitude = 0 THEN
               RETURN (result);
            END_IF;
            result := dummy_gri || direction([ d1, d2, d3 ]);
         END;
      END_IF;
      RETURN (result);
END_FUNCTION;

Referenced By

Defintion get_relative_direction_2points is references by the following definitions:
DefinitionType
 implicit_point_on_plane ENTITY


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2020-07-28T17:02:20-04:00