2D跨产品定义 [英] 2d cross product definition

查看:53
本文介绍了2D跨产品定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

确定线段是否在多边形内中,我注意到接受的答案具有以下不同寻常的二维交叉定义:

In determine if line segment is inside polygon I noticed the accepted answer has an unusual 2d cross roduct definition of:

(u1, u2) x (v1, v2) := (u1 - v2)*(u2 - v1)

我从未遇到过像这样的2d叉积的定义.有人能启发我这个定义的起源吗?

I have never encountered a definition of the 2d cross product such as this one. Can anyone enlighten me as to where such definition originates from?

推荐答案

我建议您看看外部代数.它概括了叉积和行列式的概念.描述飞机上各个区域的动机示例"部分完全可以回答您的问题.

I suggest you to take a look at Exterior Algebra. It generalizes the notion of cross product and determinant. The "Motivation examples" section describing areas in the plane answers exactly your question.

它可以在任何维度上使用. 3D是一种特殊情况,其中两个向量的叉积的结果也具有3个分量.但是,在2D中只有一个结果分量,而在4D中只有6个分量.在4D中,您可以使用3个向量应用叉积,这也为您提供4个分量.

It works in any dimension. 3D is a specific case where the result of the cross product of two vectors also has 3 components. However, in 2D, there is only one resulting component, and in 4D, there is 6. In 4D, you can apply a kind of cross product using 3 vectors, which give you also 4 components.

重要的是要注意,尽管3D叉积的结果包含3个成分,但单位和含义是不同的.例如,与标准"向量相反,x分量具有面积单位,并表示YZ平面中的面积,在标准"向量中,x分量具有长度单位,而差是坐标.使用外部代数,由于符号也有所不同(dxdy^dz),这些区别变得更加明显.

It is important to note that while the result of a cross product in 3D has 3 components, the units and the meaning are different. For example, the x-component has units of area, and represents the area in the YZ plane, as opposed to a "standard" vector where the x-component has unit of length and is a difference is coordinates. Using exterior algebra, these differences become clearer since the notation is also different (dx vs dy^dz).

注意:您引用的答案有误.而不是(u1, u2) x (v1, v2) := (u1 - v2)*(u2 - v1),它应该是(u1, u2) x (v1, v2) := u1*v2 - u2*v1

Note: The answer that you referenced has a mistake. Instead of (u1, u2) x (v1, v2) := (u1 - v2)*(u2 - v1), it should be (u1, u2) x (v1, v2) := u1*v2 - u2*v1

这篇关于2D跨产品定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆