Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/19.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python TypeError:compute_cross()缺少3个必需的位置参数:';w1'';w2';,和';w3';_Python_Python 3.x - Fatal编程技术网

Python TypeError:compute_cross()缺少3个必需的位置参数:';w1'';w2';,和';w3';

Python TypeError:compute_cross()缺少3个必需的位置参数:';w1'';w2';,和';w3';,python,python-3.x,Python,Python 3.x,我会尽力把这描述清楚 我在使用compute\u cross函数及其格式时遇到问题。 这是我当前的代码:(我的问题是第二个函数) 无论出于何种原因,我都会收到如下错误消息: *TypeError: compute_cross() missing 3 required positional arguments: 'w1', 'w2', and 'w3'* 如果完全删除x3、y3和z3,则会收到完全不同的错误。我似乎缺少一些额外的参数。 以下是我的指示: "The vector component

我会尽力把这描述清楚

我在使用
compute\u cross
函数及其格式时遇到问题。 这是我当前的代码:(我的问题是第二个函数)

无论出于何种原因,我都会收到如下错误消息:

*TypeError: compute_cross() missing 3 required positional arguments: 'w1', 'w2', and 'w3'*
如果完全删除x3、y3和z3,则会收到完全不同的错误。我似乎缺少一些额外的参数。

以下是我的指示:

"The vector components (vector coordinates) through two points (initial and terminal points) in
three-dimensional space is calculated as the difference between the coordinates of each point.
例如,如果A和B是具有坐标(x1、y1、z1)和 (x2,y2,z2)矢量AB的坐标分别为: (x2-x1,y2-y1,z2-z1)

找到两边的向量,然后用你的计算得到它们的叉积 功能。”

函数在到达
compute\u cross
之前似乎运行良好,但我完全搞糊涂了。非常感谢您的帮助。

您的compute\u cross(v1、v2、v3、w1、w2、w3)函数包含6个位置参数,第一个三位一体(v1-3)表示一个向量,第二个三位一体-另一个

调用compute_cross(x3,y3,z3)时,参数x3,y3,z3从原始签名分配给v1,v2,v3,因为它们在函数签名中占据前三个位置

然而,当您只传递一组坐标时,compute cross需要两个向量(两个坐标的三位一体)


你必须通过计算交叉调用另一个向量。

嗨,picklemaster,计算交叉从何而来?我错了,我刚刚编辑了这篇文章以包含计算交叉
"The vector components (vector coordinates) through two points (initial and terminal points) in
three-dimensional space is calculated as the difference between the coordinates of each point.