computes the modified parameters for a Givens rotation.

@param d1
@param d2
@param b1
@param b2
@param P
339285
@Override
    public void rotmg(INDArray d1, INDArray d2, INDArray b1, double b2, INDArray P) {
        throw new UnsupportedOperationException();
    }
1316612
function(p1, p2) {
		_tempPoint.x = Math.abs( p1.x - p2.x );
		_tempPoint.y = Math.abs( p1.y - p2.y );
		return Math.sqrt(_tempPoint.x * _tempPoint.x + _tempPoint.y * _tempPoint.y);
	}
440093
def pmag_angle(D1,D2): # use this 
    
    D1 = numpy.array(D1)
    if len(D1.shape) > 1:
        D1 = D1[:,0:2] # strip off intensity
    else: D1 = D1[:2]
    D2 = numpy.array(D2)
    if len(D2.shape) > 1:
        D2 = D2[:,0:2] # strip off intensity
    else: D2 = D2[:2]
    X1 = dir2cart(D1) # convert to cartesian from polar
    X2 = dir2cart(D2)
    angles = [] # set up a list for angles
    for k in range(X1.shape[0]): # single vector
        angle = numpy.arccos(numpy.dot(X1[k],X2[k]))*180./numpy.pi # take the dot product
        angle = angle%360.
        angles.append(angle)
    return numpy.array(angles)
1339440
@Override
	public double execute(Geometry geom1, Geometry geom2,
			ProgressTracker progressTracker) {
		if (null == geom1 || null == geom2) {
			throw new IllegalArgumentException();
		}

		Geometry geometryA = geom1;
		Geometry geometryB = geom2;

		if (geometryA.isEmpty() || geometryB.isEmpty())
			return NumberUtils.TheNaN;		

		Polygon polygonA;
		Polygon polygonB;
		MultiPoint multiPointA;
		MultiPoint multiPointB;

		// if geometryA is an envelope use a polygon instead (if geom1 was
		// folded, then geometryA will already be a polygon)
		// if geometryA is a point use a multipoint instead
		Geometry.Type gtA = geometryA.getType();
		Geometry.Type gtB = geometryB.getType();
		if (gtA == Geometry.Type.Point) {
			if (gtB == Geometry.Type.Point) {
				return Point2D.distance(((Point)geometryA).getXY(), ((Point)geometryB).getXY());
			}
			else if (gtB == Geometry.Type.Envelope) {
				Envelope2D envB = new Envelope2D();
				geometryB.queryEnvelope2D(envB);
				return envB.distance(((Point)geometryA).getXY());
			}
			
			multiPointA = new MultiPoint();
			multiPointA.add((Point) geometryA);
			geometryA = multiPointA;
		} else if (gtA == Geometry.Type.Envelope) {
			if (gtB == Geometry.Type.Envelope) {
				Envelope2D envA = new Envelope2D();
				geometryA.queryEnvelope2D(envA);
				Envelope2D envB = new Envelope2D();
				geometryB.queryEnvelope2D(envB);
				return envB.distance(envA);
			}
			polygonA = new Polygon();
			polygonA.addEnvelope((Envelope) geometryA, false);
			geometryA = polygonA;
		}

		// if geom_2 is an envelope use a polygon instead
		// if geom_2 is a point use a multipoint instead
		if (gtB == Geometry.Type.Point) {
			multiPointB = new MultiPoint();
			multiPointB.add((Point) geometryB);
			geometryB = multiPointB;
		} else if (gtB == Geometry.Type.Envelope) {
			polygonB = new Polygon();
			polygonB.addEnvelope((Envelope) geometryB, false);
			geometryB = polygonB;
		}

		DistanceCalculator distanceCalculator = new DistanceCalculator(
				progressTracker);
		double distance = distanceCalculator.calculate(geometryA, geometryB);
		return distance;
	}
1317568
private static void reflect(Tuple2d p, Tuple2d base, double a, double b) {
        double x = a * (p.x - base.x) + b * (p.y - base.y) + base.x;
        double y = b * (p.x - base.x) - a * (p.y - base.y) + base.y;
        p.x = x;
        p.y = y;
    }
1285349
@Override
	public void setFromCorners(Point3D p1, Point3D p2) {
		setFromCorners(
				p1.getX(), p1.getY(), p1.getZ(),
				p2.getX(), p2.getY(), p2.getZ());
	}
263888
def _complement(d1,d2):
    '''
        
    '''
    u = _union(d1,d2)
    c = _diff(u,d1)
    return(c)
455041
@SuppressWarnings("deprecation")
	public static boolean dateEquals(java.util.Date d1, java.util.Date d2) {
        if (d1 == null || d2 == null) {
            return false;
        }

        return d1.getDate() == d2.getDate()
                && d1.getMonth() == d2.getMonth()
                && d1.getYear() == d2.getYear();
    }
665008
public static void projectionCombine( DMatrixRMaj M , Vector3D_F64 T , DMatrixRMaj P ) {
		CommonOps_DDRM.insert(M,P,0,0);
		P.data[3] = T.x;
		P.data[7] = T.y;
		P.data[11] = T.z;
	}
103065
def jsd(p1, p2):
    
    m = (p1 + p2) / 2
    return (kld(p1, m) + kld(p2, m)) / 2
131156
public static final Point subtract(Point p1, Point p2)
    {
        return new AbstractPoint(p1.getX() - p2.getX(), p1.getY() - p2.getY());
    }
538459
public void addRotation(int axis1, int axis2, double angle) {
    if(trans == null) {
      trans = new AffineTransformation(dim);
    }
    trans.addRotation(axis1, axis2, angle);
  }
1168901
public void rotate(Quaternion rotation, Point3D pivot1) {
		if (pivot1==null) {
			rotate(rotation);
		} else {
			Transform3D m = new Transform3D();
			m.setRotation(rotation);

			// Translate to the pivot
			this.getP1().setX(this.getP1().getX() - pivot1.getX());
			this.getP1().setY(this.getP1().getY() - pivot1.getY());
			this.getP1().setZ(this.getP1().getZ() - pivot1.getZ());

			m.transform(this.getP1());

			this.getP1().setX(this.getP1().getX() + pivot1.getX());
			this.getP1().setY(this.getP1().getY() + pivot1.getY());
			this.getP1().setZ(this.getP1().getZ() + pivot1.getZ());

			// Rotate the direction
			m.transform(this.getSegmentVector());
			this.getSegmentVector().normalize();
		}
	}
230910
public void addRotation(int axis1, int axis2, double angle) {
    // TODO: throw an exception instead of using assert
    assert (axis1 >= 0);
    assert (axis1 < dim);
    assert (axis1 >= 0);
    assert (axis2 < dim);
    assert (axis1 != axis2);

    // reset inverse transformation - needs recomputation.
    inv = null;

    double[][] ht = new double[dim + 1][dim + 1];
    // identity matrix
    for(int i = 0; i < dim + 1; i++) {
      ht[i][i] = 1.0;
    }
    // insert rotation values
    final DoubleWrapper tmp = new DoubleWrapper(); // To return cosine
    double s = FastMath.sinAndCos(angle, tmp), c = tmp.value;
    ht[axis1][axis1] = +c;
    ht[axis1][axis2] = -s;
    ht[axis2][axis1] = +s;
    ht[axis2][axis2] = +c;
    // Multiply from left
    trans = times(ht, trans);
  }
1132914
public void rotate(double t, double p) {
        theta = theta - t / 100;
        phi = phi + p / 100;
        precompute();
        reset();
    }
1355141
public final double getDistanceKmToPath(Position p1, Position p2) {
		double d = radiusEarthKm
				* asin(sin(getDistanceToKm(p1) / radiusEarthKm)
						* sin(toRadians(getBearingDegrees(p1)
								- p1.getBearingDegrees(p2))));
		return abs(d);
	}
1247445
public void set(double a, double b, double c, double d) {
		this.aProperty.set(a);
		this.bProperty.set(b);
		this.cProperty.set(c);
		this.dProperty.set(d);
		clearBufferedValues();
	}