code: public void legalize( TriangulationPoint oPoint, TriangulationPoint nPoint )
      {
          if( oPoint == points[0] )
          {
              points[1] = points[0];
              points[0] = points[2];
              points[2] = nPoint;
          }
          else if( oPoint == points[1] )
          {
              points[2] = points[1];
              points[1] = points[0];
              points[0] = nPoint;
          }
          else if( oPoint == points[2] )
          {
              points[0] = points[2];
              points[2] = points[1];
              points[1] = nPoint;
          }
          else
          {
              logger.error( "legalization error" );
              throw new RuntimeException("legalization bug");
          }
      }
docs: Legalize triangle by rotating clockwise around oPoint