Skip to content
GitLab
    • GitLab: the DevOps platform
    • Explore GitLab
    • Install GitLab
    • How GitLab compares
    • Get started
    • GitLab docs
    • GitLab Learn
  • Pricing
  • Talk to an expert
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
    • Switch to GitLab Next
    Projects Groups Topics Snippets
  • Register
  • Sign in
  • eigen eigen
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 684
    • Issues 684
    • List
    • Boards
    • Service Desk
    • Milestones
    • Requirements
  • Custom issue tracker
    • Custom issue tracker
  • Merge requests 21
    • Merge requests 21
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • libeigenlibeigen
  • eigeneigen
  • Issues
  • #1037
Closed
Open
Issue created Dec 04, 2019 by Eigen Bugzilla@eigenbzReporter

cross products of vectors of dimensions other than 3

Submitted by Michael

Assigned to Nobody

Link to original bugzilla bug (#1037)
Version: 3.4 (development)

Description

I would like to request a cross product of 2D vectors.

Eigen defines cross product only for vectors of size 3; however, cross product is defined (although under a different name) for vectors of arbitrary equal sizes.

In particular, cross product of vectors of size 2 is very useful in computational geometry. The result should be a scalar equal to the signed area of a parallelepiped spanned by the input vectors. Or, to put it differently, cross product of (v1, v2) and (w1, w2) should be the 3rd coordinate of the cross product of (v1, v2, 0) and (w1, w2, 0).

In general, cross product of N dimensional vectors is a skew-symmetric NxN matrix with i,j-th entry equal, up to the sign, v[i]*w[j]-v[j]*w[i].

Since skew-symmetric 3x3 matrices have only 3 independent components (the ones above the diagonal), cross-product of 3D vectors is naturally represented as Vector3. If fact, most of literature that mentions cross-products bypasses the matrix definition and exposes only the 3D vector that naturally represents it.

Similarly, skew-symmetric 2x2 matrices have only 1 independent component; therefore the result could be treated as a scalar.

The computations that are naturally representable as cross products of 2D vectors occur very often in computing areas and intersections and integration. Therefore it would be useful if Eigen would implement Vector2.cross as was done for Vector3.cross.

I am not confident though whether implementing cross product in full generality, for vectors of arbitrary equal sizes, would be useful.

Edited Dec 05, 2019 by Eigen Bugzilla
Assignee
Assign to
Time tracking