Given the interpolated index, compute the angle from the 3 indexes.  The angle for each index
is computed from the weighted gradients.
@param offset Interpolated index offset relative to index0.  range -1 to 1
@return Interpolated angle.
198019
double interpolateAngle(int index0, int index1, int index2, double offset) {
		double angle1 = Math.atan2(histogramY[index1],histogramX[index1]);
		double deltaAngle;
		if( offset < 0 ) {
			double angle0 = Math.atan2(histogramY[index0],histogramX[index0]);
			deltaAngle = UtilAngle.dist(angle0,angle1);

		} else {
			double angle2 = Math.atan2(histogramY[index2], histogramX[index2]);
			deltaAngle = UtilAngle.dist(angle2,angle1);
		}
		return UtilAngle.bound(angle1 + deltaAngle*offset);
	}
15020
protected final int isLeft(double[] a, double[] b, double[] o) {
    final double cross = getRX(a, o) * getRY(b, o) - getRY(a, o) * getRX(b, o);
    if(cross == 0) {
      // Compare manhattan distances - same angle!
      final double dista = Math.abs(getRX(a, o)) + Math.abs(getRY(a, o));
      final double distb = Math.abs(getRX(b, o)) + Math.abs(getRY(b, o));
      return Double.compare(dista, distb);
    }
    return Double.compare(cross, 0);
  }
1175705
public static double angle(double[] v1, double[] v2) {
    final int mindim = (v1.length <= v2.length) ? v1.length : v2.length;
    // Essentially, we want to compute this:
    // v1.transposeTimes(v2) / (v1.euclideanLength() * v2.euclideanLength());
    // We can just compute all three in parallel.
    double s = 0, e1 = 0, e2 = 0;
    for(int k = 0; k < mindim; k++) {
      final double r1 = v1[k], r2 = v2[k];
      s += r1 * r2;
      e1 += r1 * r1;
      e2 += r2 * r2;
    }
    for(int k = mindim; k < v1.length; k++) {
      final double r1 = v1[k];
      e1 += r1 * r1;
    }
    for(int k = mindim; k < v2.length; k++) {
      final double r2 = v2[k];
      e2 += r2 * r2;
    }
    double a = FastMath.sqrt((s / e1) * (s / e2));
    return (a < 1.) ? a : 1.;
  }
759598
private int getOffset(int x, int y) {
    return (y < x) ? (triangleSize(x) + y) : (triangleSize(y) + x);
  }
92657
public Collection<Location> getLocationsContainingInstructionWithOffset(int offset) {
        LinkedList<Location> result = new LinkedList<>();
        for (Iterator<Location> i = locationIterator(); i.hasNext();) {
            Location location = i.next();
            if (location.getHandle().getPosition() == offset) {
                result.add(location);
            }
        }
        return result;
    }
967325
public Point interpolate(double distance) {
        if (distance < 0) {
            return null;
        }

        for (LineSegment segment : this.segments) {
            double length = segment.length();
            if (distance <= length) {
                return segment.pointAlongLineSegment(distance);
            }
            distance -= length;
        }
        return null;
    }
441871
public Matrix4d translation(Vector3fc offset) {
        return translation(offset.x(), offset.y(), offset.z());
    }
1103538
private int computeOffset(int x, int y) {
    if(y > x) {
      return computeOffset(y, x);
    }
    return ((x * (x + 1)) >> 1) + y;
  }
497679
public int[][] getAoMatrix(EnumFacing offset)
	{
		int[][] a = new int[3][3];

		if (offset == EnumFacing.WEST || offset == EnumFacing.EAST)
		{
			a[0][0] = a[1][0] = a[2][0] = offset.getFrontOffsetX();
			a[1][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[2][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[0][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
			a[1][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
		}
		else if (offset == EnumFacing.UP || offset == EnumFacing.DOWN)
		{
			a[0][1] = a[1][1] = a[2][1] = offset.getFrontOffsetY();
			a[1][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[2][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[0][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
			a[1][2] += Math.round(z * 2 - 1); // -1 if 0, 1 if 1;
		}
		else if (offset == EnumFacing.NORTH || offset == EnumFacing.SOUTH)
		{
			a[0][2] = a[1][2] = a[2][2] = offset.getFrontOffsetZ();
			a[1][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[2][0] += Math.round(x * 2 - 1); // -1 if 0, 1 if 1;
			a[0][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
			a[1][1] += Math.round(y * 2 - 1); // -1 if 0, 1 if 1;
		}

		return a;
	}
394613
public Query offset(final Integer offset) {
        this.offset = offset;

        // If we defined offset without limit, force a limit to handle MySQL and others gracefully.
        if (limit <= 0) {
            limit = Integer.MAX_VALUE - offset;
        }

        return this;
    }
78521
public int getInt(int offset)
  {
    byte []code = getCode();
    
    int b0 = code[offset + 0] & 0xff;
    int b1 = code[offset + 1] & 0xff;
    int b2 = code[offset + 2] & 0xff;
    int b3 = code[offset + 3] & 0xff;
    
    return (b0 << 24) + (b1 << 16) + (b2 << 8) + b3;
  }
152020
static public double sine(Angle angle) {
        double result = lock(Math.sin(angle.value));
        return result;
    }
139937
public float[] get(float[] arr, int offset) {
        arr[offset+0] = (float)m00;
        arr[offset+1] = (float)m01;
        arr[offset+2] = (float)m02;
        arr[offset+3] = (float)m10;
        arr[offset+4] = (float)m11;
        arr[offset+5] = (float)m12;
        arr[offset+6] = (float)m20;
        arr[offset+7] = (float)m21;
        arr[offset+8] = (float)m22;
        return arr;
    }
1304888
public final int getIndex( int coordinate[] ) {
		int index = coordinate[0]*strides[0];
		for (int i = 1; i < coordinate.length; i++) {
			index += strides[i]*coordinate[i];
		}

		return index;
	}
1119548
public float angle(Vector other) {
        double dot = dot(other) / (length() * other.length());

        return (float) Math.acos(dot);
    }
364508
public function distanceOffset($offset = 0)
    {
        // Return value
        if (empty($offset)) {
            return $this->distanceOffset;
        }

        // Set value
        $this->distanceOffset = $offset;

        return $this;
    }
1059261
static public double tangent(Angle angle) {
        double result = lock(Math.tan(angle.value));
        return result;
    }