Returns an angle between 0 and PI/4 which describes the difference in slope
between the two sides
358294
public double acuteAngle(  SquareNode a , int sideA , SquareNode b , int sideB ) {
		Point2D_F64 a0 = a.square.get(sideA);
		Point2D_F64 a1 = a.square.get(add(sideA, 1));

		Point2D_F64 b0 = b.square.get(sideB);
		Point2D_F64 b1 = b.square.get(add(sideB, 1));

		vector0.set(a1.x - a0.x, a1.y - a0.y);
		vector1.set(b1.x - b0.x, b1.y - b0.y);

		double acute = vector0.acute(vector1);
		return Math.min(UtilAngle.dist(Math.PI, acute), acute);
	}
3720
def angle_between_vectors(x, y):
    
    dp = dot_product(x, y)
    if dp == 0:
        return 0
    xm = magnitude(x)
    ym = magnitude(y)
    return math.acos(dp / (xm*ym)) * (180. / math.pi)
526541
def angle_to(self, rhs):
    

    return math.acos(self.dot(rhs) / (self.magnitude() * rhs.magnitude()))
1246465
def get_angle(self, i: int, j: int, k: int) -> float:
        
        v1 = self[i].coords - self[j].coords
        v2 = self[k].coords - self[j].coords
        return get_angle(v1, v2, units="degrees")
1175411
def angle(vec1, vec2):
        """"""
        dotp = Vector2.dot(vec1, vec2)
        mag1 = vec1.length()
        mag2 = vec2.length()
        result = dotp / (mag1 * mag2)
        return math.acos(result)
44087
def derivative(self, t, n=1):
        """"""
        angle = radians(self.theta + t*self.delta)
        phi = radians(self.rotation)
        rx = self.radius.real
        ry = self.radius.imag
        k = (self.delta*2*pi/360)**n  # ((d/dt)angle)**n

        if n % 4 == 0 and n > 0:
            return rx*cos(phi)*cos(angle) - ry*sin(phi)*sin(angle) + 1j*(
                rx*sin(phi)*cos(angle) + ry*cos(phi)*sin(angle))
        elif n % 4 == 1:
            return k*(-rx*cos(phi)*sin(angle) - ry*sin(phi)*cos(angle) + 1j*(
                -rx*sin(phi)*sin(angle) + ry*cos(phi)*cos(angle)))
        elif n % 4 == 2:
            return k*(-rx*cos(phi)*cos(angle) + ry*sin(phi)*sin(angle) + 1j*(
                -rx*sin(phi)*cos(angle) - ry*cos(phi)*sin(angle)))
        elif n % 4 == 3:
            return k*(rx*cos(phi)*sin(angle) + ry*sin(phi)*cos(angle) + 1j*(
                rx*sin(phi)*sin(angle) - ry*cos(phi)*cos(angle)))
        else:
            raise ValueError("n should be a positive integer.")
301566
def _opbend_angle_low(a, b, c, deriv=0):
    """"""
    result = _opbend_cos_low(a, b, c, deriv)
    sign = np.sign(np.linalg.det([a, b, c]))
    return _cos_to_angle(result, deriv, sign)
349656
def get_slope(self):
        """"""
        # y1 = m*x1 + t
        # y2 = m*x2 + t => y1-y2 = m*(x1-x2) <=> m = (y1-y2)/(x1-x2)
        return ((self.p1.y-self.p2.y) / (self.p1.x-self.p2.x))
712382
def slope (self):
    
    return (self.p.y - self.q.y) / (self.p.x - self.q.x)
71977
def get_azimuth_plunge(vect, degrees=True):
    '''
    
    '''
    if vect[0] > 0:
        vect = -1. * np.copy(vect)
    vect_hor = sqrt(vect[1] ** 2. + vect[2] ** 2.)
    plunge = atan2(-vect[0], vect_hor)
    azimuth = atan2(vect[2], -vect[1])
    if degrees:
        icr = 180. / pi
        return icr * azimuth % 360., icr * plunge
    else:
        return azimuth % (2. * pi), plunge
22231
function getAngle(p1, p2, props) {
  if (!props) {
    props = PROPS_XY;
  }
  var x = p2[props[0]] - p1[props[0]];
  var y = p2[props[1]] - p1[props[1]];
  return Math.atan2(y, x) * 180 / Math.PI;
}
591573
def angle(self, vector):
        """"""
        return math.degrees(
            math.acos(
                self.dot(vector) /
                (self.magnitude() * vector.magnitude())
            )
        )
349714
def add(self, p0, p1):
        
        p = self._p
        infinity = self._infinity

        if p0 == infinity:
            return p1
        if p1 == infinity:
            return p0

        x0, y0 = p0
        x1, y1 = p1
        if (x0 - x1) % p == 0:
            if (y0 + y1) % p == 0:
                return infinity
            else:
                slope = ((3 * x0 * x0 + self._a) * self.inverse_mod(2 * y0, p)) % p
        else:
            slope = ((y1 - y0) * self.inverse_mod(x1 - x0, p)) % p

        x3 = (slope * slope - x0 - x1) % p
        y3 = (slope * (x0 - x3) - y0) % p

        return self.Point(x3, y3)
898721
def get_offset(self):
        """"""
        return self.p1.y-self.get_slope()*self.p1.x
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)
79405
def principal_angle(A,B):
    
    from numpy.linalg import qr, svd
    qA, _ = qr(A)
    qB, _ = qr(B)
    U,S,V = svd(qA.T.dot(qB))
    return np.arccos(min(S.min(), 1.0))
649609
def _is_trivial_angle(rad: float, atol: float) -> bool:
    
    return abs(rad) < atol or abs(abs(rad) - np.pi / 4) < atol