print " Error: returned angle is", Angle, "while must be 45.0"
pass
+Angle = geompy.GetAngleRadians(OX, OXY)
+
+print "\nAngle between OX and OXY in radians = ", Angle
+if math.fabs(Angle - math.pi/4) > 1e-05:
+ print " Error: returned angle is", Angle, "while must be pi/4"
+ pass
+
# not in one plane
OXY_shift = geompy.MakeTranslation(OXY,10,-10,20)
Angle = geompy.GetAngle(OX, OXY_shift)
\anchor angle_anchor
<br><h2>Angle</h2>
-\n Returns the angle between two lines or linear edges
+\n Returns the angle between two lines or linear edges in degrees
\n <b>TUI Command:</b> <em>geompy.GetAngle(shape1, shape2),</em> where
-Shape1 and Shape2 are shapes between which the angle is computed.
+Shape1 and Shape2 are shapes between which the angle is computed.
+Another TUI command is <em>geompy.GetAngleRadians(shape1,shape2),</em>
+which returns the value of angle in radians.
\image html angle.png
aRes = [aTuple[0], aTuple[4] - aTuple[1], aTuple[5] - aTuple[2], aTuple[6] - aTuple[3]]
return aRes
- ## Get angle between the given shapes.
+ ## Get angle between the given shapes in degrees.
# @param theShape1,theShape2 Lines or linear edges to find angle between.
- # @return Value of the angle between the given shapes.
+ # @return Value of the angle between the given shapes in degrees.
#
# @ref tui_measurement_tools_page "Example"
def GetAngle(self, theShape1, theShape2):
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)
RaiseIfFailed("GetAngle", self.MeasuOp)
return anAngle
+ ## Get angle between the given shapes in radians.
+ # @param theShape1,theShape2 Lines or linear edges to find angle between.
+ # @return Value of the angle between the given shapes in radians.
+ #
+ # @ref tui_measurement_tools_page "Example"
def GetAngleRadians(self, theShape1, theShape2):
# Example: see GEOM_TestMeasures.py
anAngle = self.MeasuOp.GetAngle(theShape1, theShape2)*math.pi/180.