Optical measurement of torque exerted on an elongated object by a noncircular laser beam