二维交叉积定义 [英] 2d cross product definition

查看:25
本文介绍了二维交叉积定义的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

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

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)

我从来没有遇到过这样的二维叉积的定义.任何人都可以启发我了解这种定义的起源吗?

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 分量具有长度单位并且是坐标差.使用外部代数,这些差异变得更加清晰,因为符号也不同(dx vs dy^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

这篇关于二维交叉积定义的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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