FUNCTION normalise

(* SCHEMA step_merged_ap_schema; *)
-- DIFF IN AP214
-- DIFF IN AP203e2
-- DIFF IN AP238 STEP-NC
-- DIFF IN AP224
-- DIFF IN AP232
FUNCTION normalise
      (arg : vector_or_direction ) : vector_or_direction;
   LOCAL
      ndim : INTEGER;
      v : direction := dummy_gri || direction([ 1, 0, 0 ]);
      result : vector_or_direction;
      vec : vector := dummy_gri || vector(v, 1);
      mag : REAL;
   END_LOCAL;
      IF NOT EXISTS(arg) THEN
         result := ?;
      ELSE
         ndim := arg.dim;
         IF 'STEP_MERGED_AP_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
            BEGIN
               v := dummy_gri || direction(arg\vector.orientation.direction_ratios);
               IF arg\vector.magnitude = 0 THEN
                  RETURN (?);
               ELSE
                  vec := dummy_gri || vector(v, 1);
               END_IF;
            END;
         ELSE
            v := dummy_gri || direction(arg.direction_ratios);
         END_IF;
         mag := 0;
         REPEAT i := 1 TO ndim BY 1;
            mag := mag + v.direction_ratios[i] * v.direction_ratios[i];
         END_REPEAT;
         IF mag > 0 THEN
            mag := sqrt(mag);
            REPEAT i := 1 TO ndim BY 1;
               v.direction_ratios[i] := v.direction_ratios[i] / mag;
            END_REPEAT;
            IF 'STEP_MERGED_AP_SCHEMA.VECTOR' IN TYPEOF(arg) THEN
               vec.orientation := v;
               result := vec;
            ELSE
               result := v;
            END_IF;
         ELSE
            RETURN (?);
         END_IF;
      END_IF;
      RETURN (result);
END_FUNCTION;

Referenced By

Defintion normalise is references by the following definitions:
DefinitionType
 axis1_placement ENTITY
 base_axis FUNCTION
 build_2axes FUNCTION
 build_axes FUNCTION
 convert_spatial_to_ypr_rotation FUNCTION
 cross_product FUNCTION
 dot_product FUNCTION
 first_proj_axis FUNCTION
 scalar_times_vector FUNCTION
 second_proj_axis FUNCTION
 vector_difference FUNCTION


[Top Level Definitions] [Exit]

Generated by STEP Tools® EXPRESS to HTML Converter
2017-01-19T11:17:24-05:00