AngleΒΆ

The Angle class is a data holder for an angle value. The internal value is a radian.

There are the following groups of member functions with some examples of use:

  • construct the angle with a radian or degree value
    import math
    import NemAll_Python_Geometry as AllplanGeo
    
    angle = AllplanGeo.Angle()
    angle.Deg = 180.0
    
    angle = AllplanGeo.Angle(math.pi)
    ...
    
  • convert the angle between radians and degrees
    radian = AllplanGeo.Angle.DegToRad(180)
    
    deg = AllplanGeo.Angle.DegToRad(math.pi)
    ...
    
  • normalize the angle
    angle.NormalizePi()
    ...
    
  • changing the angle by basic mathematical operations like + and -
    angle -= AllplanGeo.Angle(math.pi)
    angle1 = angle + AllplanGeo.Angle(1.5 * math.pi)
    ...
    
  • comparing angles
    if angle == AllplanGeo.Angle(math.pi):
       ...
    ...
    
The AngleList class is a special list for Angle objects and can be used like
anglelist = AllplanGeo.AngleList()
anglelist.append(AllplanGeo.Angle(math.pi))
anglelist.append(AllplanGeo.Angle(2 * math.pi))

The complete documentation of the members from the Angle and AngleList class can be found here: