/* (non-Javadoc)
@see org.joml.Vector3fc#angle(org.joml.Vector3fc)
486665
public float angle(Vector3fc v) {
        float cos = angleCos(v);
        // This is because sometimes cos goes above 1 or below -1 because of lost precision
        cos = cos < 1 ? cos : 1;
        cos = cos > -1 ? cos : -1;
        return (float) Math.acos(cos);
    }
1118152
public static Double azimuth(Geometry pointA, Geometry pointB){
        if(pointA == null||pointB == null){
            return null;
        }
        if ((pointA instanceof Point) && (pointB instanceof Point)) {
            Double angle ;
            double x0 = ((Point) pointA).getX();
            double y0 = ((Point) pointA).getY();
            double x1 = ((Point) pointB).getX();
            double y1 = ((Point) pointB).getY();

            if (x0 == x1) {
                if (y0 < y1) {
                    angle = 0.0;
                } else if (y0 > y1) {
                    angle = Math.PI;
                } else {
                    angle = null;
                }
            } else

            if (y0 == y1) {
                if (x0 < x1) {
                    angle = Math.PI / 2;
                } else if (x0 > x1) {
                    angle = Math.PI + (Math.PI / 2);
                } else {
                    angle = null;
                }
            } else

            if (x0 < x1) {
                if (y0 < y1) {
                    angle = Math.atan(Math.abs(x0 - x1) / Math.abs(y0 - y1));
                } else { /* ( y0 > y1 ) - equality case handled above */
                    angle = Math.atan(Math.abs(y0 - y1) / Math.abs(x0 - x1)) + (Math.PI / 2);
                }
            }

            else { /* ( x0 > x1 ) - equality case handled above */
                if (y0 > y1) {
                    angle = Math.atan(Math.abs(x0 - x1) / Math.abs(y0 - y1)) + Math.PI;
                } else { /* ( y0 < y1 ) - equality case handled above */
                    angle = Math.atan(Math.abs(y0 - y1) / Math.abs(x0 - x1)) + (Math.PI + (Math.PI / 2));
                }
            }
            return angle;
        }
        return null;
    }
1171583
@Pure
	@Inline(value = "new Vector2d(Math.cos($1), Math.sin($1))", imported = {Vector2d.class, Math.class})
	public static Vector2d toOrientationVector(double angle) {
		return new Vector2d(Math.cos(angle), Math.sin(angle));
	}
579507
public static double angleBetween( LineSegment l1, LineSegment l2 ) {
        double azimuth1 = azimuth(l1.p0, l1.p1);
        double azimuth2 = azimuth(l2.p0, l2.p1);

        if (azimuth1 < azimuth2) {
            return azimuth2 - azimuth1;
        } else {
            return 360 - azimuth1 + azimuth2;
        }
    }
1106197
function unit_vector_angle(ux, uy, vx, vy) {
  var sign = (ux * vy - uy * vx < 0) ? -1 : 1;
  var dot  = ux * vx + uy * vy;

  // Add this to work with arbitrary vectors:
  // dot /= Math.sqrt(ux * ux + uy * uy) * Math.sqrt(vx * vx + vy * vy);

  // rounding errors, e.g. -1.0000000000000002 can screw up this
  if (dot >  1.0) { dot =  1.0; }
  if (dot < -1.0) { dot = -1.0; }

  return sign * Math.acos(dot);
}
864870
public void rotate(Vector3D axis, double angle, Point3D pivot) {
		Quaternion q = new Quaternion();
		q.setAxisAngle(axis, angle);
		rotate(q, pivot);
   	}
573892
public static double angle(Quat4d q) {
		AxisAngle4d axis = new AxisAngle4d();
		axis.set(q);
		return axis.angle;
	}
790750
public Quaternion fromAngles (Vector3 angles) {
        return fromAngles(angles.x, angles.y, angles.z);
    }
144566
public Quaternionf rotationAxis(float angle, Vector3fc axis) {
        return rotationAxis(angle, axis.x(), axis.y(), axis.z());
    }
570375
function(out, axis, angle) {
  var sa = Math.sin(angle), ca = Math.cos(angle), x = axis[0], y = axis[1],
      z = axis[2], xx = x * x, xy = x * y, xz = x * z, yy = y * y, yz = y * z,
      zz = z * z;

  out[0] = xx + ca - xx * ca;
  out[1] = xy - ca * xy - sa * z;
  out[2] = xz - ca * xz + sa * y;
  out[3] = xy - ca * xy + sa * z;
  out[4] = yy + ca - ca * yy;
  out[5] = yz - ca * yz - sa * x;
  out[6] = xz - ca * xz - sa * y;
  out[7] = yz - ca * yz + sa * x;
  out[8] = zz + ca - ca * zz;
  return out;
}
617151
public Matrix3 setToRotation (double angle, IVector3 axis) {
        return setToRotation(angle, axis.x(), axis.y(), axis.z());
    }
695786
@Pure
	public double fx2docAngle(double angle) {
		final ZoomableCanvas<?> canvas = getCanvas();
		if (canvas.isInvertedAxisX() != canvas.isInvertedAxisY()) {
			return -angle;
		}
		return angle;
	}
99434
public final void setAxisAngle(Vector3D axis, double angle) {
		setAxisAngle(axis.getX(),  axis.getY(), axis.getZ(), angle);
	}
351768
public Matrix3 setToRotation (IVector3 from, IVector3 to) {
        float angle = from.angle(to);
        return (angle < 0.0001f) ?
            setToIdentity() : setToRotation(angle, from.cross(to).normalizeLocal());
    }
474126
public Vector setAngle (double angle) {
        double l = length();
        return set(l * Math.cos(angle), l * Math.sin(angle));
    }
22660
def vector_angle_cos(u, v):
    '''
    
    '''
    u = np.asarray(u)
    v = np.asarray(v)
    return (u * v).sum(0) / np.sqrt((u ** 2).sum(0) * (v ** 2).sum(0))
273660
def angle( vertex_index )
      return nil if(vertex_index < 0 || vertex_index > 2)
      vert1 = self.vertices[vertex_index]
      vert2 = self.vertices[(vertex_index+1)%3]
      vert3 = self.vertices[(vertex_index+2)%3]
      vec1 = vert2 - vert1
      vec2 = vert3 - vert1
      vec1.angle(vec2)
    end