'Angle between the plane and other geometric entity.
Parameters
LinearEntity3D, Plane.
Returns
angle : angle in radians
Notes
This method accepts only 3D entities as it\'s parameter, but if you want
to calculate the angle between a 2D entity and a plane you should
first convert to a 3D entity by projecting onto a desired plane and
then proceed to calculate the angle.
Examples
>>> from sympy import Point3D, Line3D, Plane
>>> a = Plane(Point3D(1, 2, 2), normal_vector=(1, 2, 3))
>>> b = Line3D(Point3D(1, 3, 4), Point3D(2, 2, 2))
>>> a.angle_between(b)
-asin(sqrt(21)/6)'

def angle_between(self, o):

    from sympy.geometry.line import LinearEntity3D
    if isinstance(o, LinearEntity3D):
        a = Matrix(self.normal_vector)
        b = Matrix(o.direction_ratio)
        c = a.dot(b)
        d = sqrt(sum([(i ** 2) for i in self.normal_vector]))
        e = sqrt(sum([(i ** 2) for i in o.direction_ratio]))
        return asin((c / (d * e)))
    if isinstance(o, Plane):
        a = Matrix(self.normal_vector)
        b = Matrix(o.normal_vector)
        c = a.dot(b)
        d = sqrt(sum([(i ** 2) for i in self.normal_vector]))
        e = sqrt(sum([(i ** 2) for i in o.normal_vector]))
        return acos((c / (d * e)))
