code: private static double inscribed_angle(final int basepoint,
                                            final int p1,
                                            final int p2) {
          double angle1, angle2, temp;
  
          /*
           * Get the angle between line #1 and the origin and the angle between
           * line #2 and the origin, and then subtract these values.
           */
          angle1 = get_angle( basepoint,
                              p1 );
          angle2 = get_angle( basepoint,
                              p2 );
          temp = angle1 - angle2;
          if ( temp < 0.0 ) {
              temp = -temp;
          }
  
          /*
           * We always want the smaller of the two angles inscribed, so if the
           * answer is greater than 180 degrees, calculate the smaller angle and
           * return it.
           */
          if ( temp > WaltzUtil.PI ) {
              temp = 2 * WaltzUtil.PI - temp;
          }
          if ( temp < 0.0 ) {
              return (-temp);
          }
          return (temp);
      }
docs: *************************************************************************
  This procedure is passed the basepoint of the intersection of two lines
  as well as the other two endpoints of the lines and calculates the angle
  inscribed by these three points.
  ************************************************************************