FUNCTION derive_angle

(* SCHEMA structural_analysis_design; *)
  FUNCTION derive_angle(
               placement_1, placement_2: axis2_placement_3d
      ): plane_angle_measure;

    LOCAL
      v2     : direction;
      v1     : direction;
      mag_v2 : REAL;
      mag_v1 : REAL;
      theta  : plane_angle_measure;
    END_LOCAL;
    v1 := placement_1.p[1];
    v2 := placement_2.p[1];
    mag_v1 := SQRT((v1.direction_ratios[1] * v1.direction_ratios[1]) + (v1
        .direction_ratios[2] * v1.direction_ratios[2]));
    mag_v2 := SQRT((v2.direction_ratios[1] * v2.direction_ratios[1]) + (v2
        .direction_ratios[2] * v2.direction_ratios[2]));
    IF (mag_v1 = 0) OR (mag_v2 = 0) THEN
      theta := 0;
      RETURN(theta);
    END_IF;
    theta := ACOS(((v1.direction_ratios[1] * v2.direction_ratios[1]) + (v1
        .direction_ratios[2] * v2.direction_ratios[2])) / (mag_v1 * mag_v2));
    RETURN(theta);

  END_FUNCTION; -- derive_angle

Referenced By

Defintion derive_angle is references by the following definitions:
DefinitionType
 transformation_with_derived_angle ENTITY


[Top Level Definitions] [Exit]

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