def project_point_on_axis(axis_point_1,axis_point_2, point):
  """
  Project a 3D coordinate on a given arbitrary axis.

  :param axis_point_1: tuple representing 3D coordinate at one end of the axis
  :param axis_point_2: tuple representing 3D coordinate at other end of the axis
  :param point: tuple representing 3D coordinate of starting point to rotate
  :param deg: Python boolean (default=False), specifies whether the angle is
    in degrees
  :returns: Python tuple (len=3) of rotated point
  """
  ax, ay, az = axis_point_1
  bx, by, bz = axis_point_2
  px, py, pz = point
  abx, aby, abz = (bx-ax, by-ay, bz-az)
  apx, apy, apz = (px-ax, py-ay, pz-az)
  ap_dot_ab = apx*abx+apy*aby+apz*abz
  ab_dot_ab = abx*abx+aby*aby+abz*abz
  brackets = ap_dot_ab/ab_dot_ab
  proj = (ax+brackets*abx, ay+brackets*aby,az+brackets*abz)
  return proj