There are two issues with the code:

  1. The multiplication operator * is missing between (x2-x02) and (y-y0).

  2. The exponent operator ** should be used instead of 2 for squaring.

The corrected code is:

r2 = sum((x2-x02)*(y-y0))/(sqrt(sum((x2-x02)**2)) * sqrt(sum((y-y0)**2)))
Python SyntaxError: invalid syntax - File '<ipython-input-10-755483d6a0c5>', line 8

原文地址: https://www.cveoy.top/t/topic/oHxT 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录