# Can I replace the cross product with the wedge product?

This topic is 3409 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

As you know the cross product is only defined for vectors in 3 and 7 dimensions. Now I would like to implement an analog to the cross product in 2 dimensions which produces a scalar as follows: (x0, y0) ^ (x1, y1) = x0.y1 - y0.x1 (where . is multiplication) So I was thinking that since my place of work has opted to use ^ as a cross product, it seems quite elegant to instead redefine the ^ operator as the (Hodge dual of the) wedge product since this happens to be equivalent to the cross product in three dimensions. In other words: *(A^B) = A x B in three dimensions. (where * is the Hodge Dual operator, ^ is the wedge product and x is the cross product) As far as I can tell this also does what I want it to in two dimensions (using this reference): *(A^B) = A0.B1 - A1.B0 in two dimensions QUESTION: 1. So I had been thinking, is it permissible to replace our ^ operator with the Hodge Dual of a wedge product for vectors of all dimensions? 2. In other words could I extend this operation in a useful manner to vectors of higher dimensions? 3. And finally I suppose you could then write all *(A^B) in a matrix form? E.g. as for the 3D cross-product:
        [  0  -A2   A1 ]   [ B0 ]
A x B = [  A2  0   -A0 ] * [ B1 ]
[ -A1  A0   0  ]   [ B2 ]

Unfortunately I have some pressing deadlines so I can't spend too much time studying the math. Any commentary will be much appreciated and I apologize for any ignorance on my part! ;)

##### Share on other sites
The dual of a 2-blade in 3 dimenions results in a 1-blade (vector) perpendicular to this 2-blade (where the 2-blade represents a plane in euclidian space).

n = (a ^ b)*

This can easily be used in the same way for higher dimensions, but will not have the geometrical significance of a normal vector. Instead, the dual of a plane in 4D will result in another (dual)plane.

In short, only the dual of a pseudoscalar results in a scalar. A pseudoscalar is a k-blade in a k-dimensional space (plane in 2D, sphere in 3D, hypersphere in 4D).

The crossproduct only works for 3D (and for converted 2D).

About the matrices, I'm not sure it's that easy. I've never looked into it.

##### Share on other sites
I'm afraid most of that went over my head (I'm sorry I have no experience with Clifford algebra), but I think I get what you're saying anyway, since I suspected as much. From here the 4d dual of a bi-vector is this:
Dual(e31) = e1234 . e31 = e42which is still a bi-vector. (I hope I'm making sense since I don't really know what I'm talking about ;) )I guess I was trying to find a nice analog to the cross-product which is general enough to be meaningful for all dimensions but happens to give the determinant in two dimensions and the cross product in three dimensions... It seems inelegant to limit an operator to a finite number of dimensions. (Damn you Nature! :) ) 
 0 
 Share this post Link to post Share on other sites 
 
 
 rozz666    896 rozz666 Member 896 Posted January 24, 2009 The cross product is defined for n-dimensional space and you need n-1 vectors to calculate it. For 3D it's: [ i j k ]u (x) v = [ ux uy uz ] [ vx vy vz ]I'm not sure it makes sense for 2D (I used the concept sometimes):(x)(u) = [ i j ] = [ uy, -ux ] [ ux uy ]For 4D it's: [ i j k l ](x)(u, v, w) = [ ux uy uz uw ] [ vx vy vz vw ] [ wx wy wz ww ]And so on... 0 Share this post Link to post Share on other sites errantkid    188 errantkid Member 188 Posted January 24, 2009 Hi rozz, ah yes thanks I take your meaning! To give some context, I was previously looking at this thread.I'm actually looking for an alternative operator to the cross-product that happens to suit my needs (I.e. an operator that operates on only two operands). The wedge product happens to do what I want for the 2D and the 3D case and looks a lot like the binary ^ operator. On the other hand combining three operands using ^ is not possible, so essentially I want to redefine my old cross-product ^ as a wedge-product ^. I'm thinking if you want to retain the cross product, maybe you should define it as cross(x,y,z,...) to retain consistency across all dimensions.So I guess I'm testing the water to see whether others think that it would be a good idea to redefine my ^ as a dual(wedge product). Unfortunately this dual wedge product doesn't seem to extend nicely past 3 dimensions :_( 0 Share this post Link to post Share on other sites yahastu    154 yahastu Member 154 Posted January 24, 2009 The cross product has a geometric meaning that is useful in 3 dimensions..what good is it for 2 or n-dimensions, whats the point? 0 Share this post Link to post Share on other sites errantkid    188 errantkid Member 188 Posted January 24, 2009 Well, the cross product is definitely useful in 2 dimensions: it gives you an orthogonal vector.The wedge product is also useful in 2 dimensions: it gives you the determinant of | A B | which is what I'm using right now for triangle-triangle intersection.As for higher dimensions, who knows what it's useful for? For example, I used to think that eigen-vectors and eigen-values were useless too, but since then I've discovered a multitude of uses for them. Admittedly I can't imagine a use for the 4d wedge product, but maybe someone will disagree with me? 0 Share this post Link to post Share on other sites Christer Ericson    840 Christer Ericson Member 840 Posted January 24, 2009 Quote:Original post by errantkid2. In other words could I extend this operation in a useful manner to vectors of higher dimensions?You might, but even so I would consider it bad for a number of reasons, including being overengineered and overly complex. (In fact, I consider overloading circumflex to be the cross product to be bad form, but that's a different discussion.)You are better off defining a normal cross product for your 3-vectors and a pseudo-cross product for your 2-vectors. People who will use your code in the future will thank you. 0 Share this post Link to post Share on other sites yahastu    154 yahastu Member 154 Posted January 24, 2009 Found this quote by Dmytry which sums it up nicely:Quote:In 3D only. In other dimensions, cross product is not well defined, but there is well-defined analogs.In any other number of dimensions >=2, there's at least 2 different cross-product "analogs", depending to what properties of 3D cross product we want it to mimic. And 3D is just only special case when both things is the same... and there's many other useful functions possible, that is somewhat like cross product...In 2D,CrossProductAnalog1(U,V)=(U.x*V.y-U.y*V.x)CrossProductAnalog2(U)=(U.y, -U.x)(yes, second analog takes only one argument, and return orthogonal vector :)First analog makes some physical and geometrical sense, second analog comes from "determinant rule", for determinant of 2x2 matrix,|A B||C D| = AD-BCAnd in 4D, there is one analog that takes 2 4D vectors at input and return 6D vector as result. And other analog that takes 3 4D vectors, and have 4D vector as result. (3 vectors is necessary to define volume, and returned result is "normal of that volume" )Also, in 3D we can define another nice operation that takes 3 vectors at inputs, and return scalar, and is eqivalent to first 2D cross product analog.SomeFunction(A,B,C)=(A x B . C)- return volume of paralelepiped(sp?)(note that order of operands does not matter...)in summary,1: 2D cross product is not defined by itself. In general, there's several analogs, and no analogs is completely equivalent.2: you can define whatever function you *really* need and can use, and then use it.3:It is not useful to make cross product routine if you don't know it's properties.Also, "analog" doesn't really have any mathematical sense, just some properties is somewhat similar. 0 Share this post Link to post Share on other sites errantkid    188 errantkid Member 188 Posted January 24, 2009 Quote:You might, but even so I would consider it bad for a number of reasons, including being overengineered and overly complex. (In fact, I consider overloading circumflex to be the cross product to be bad form, but that's a different discussion.)Thanks, I suspected that people might feel this way. It seems I'm not the first person who has thought to do this either: threadMy problem is mainly that I want to write this kind of thing more elegantly:det1 = p1[0]*q[1]-q[0]*p1[1];gama1 = (p1[0]*r[1]-r[0]*p1[1])*det1;alpha1 = (r[0]*q[1] - q[0]*r[1])*det1;alpha1_legal = (alpha1>=0) && (alpha1<=(det1*det1) && (det1!=0));det2 = p2[0]*q[1] - q[0]*p2[1];alpha2 = (r[0]*q[1] - q[0]*r[1]) *det2;gama2 = (p2[0]*r[1] - r[0]*p2[1]) * det2;Which is from Oren Tropp's triangle intersection algo but I guess I'm stuck with it :) Perhaps I should just define a determinant function so thatdet1 = det(p1,q);gama1 = det(p1,r)*det1;alpha1 = det(r,q)*det1;alpha1_legal = (alpha1>=0) && (alpha1<=(det1*det1) && (det1!=0));det2 = det(p2,q);alpha2 = det(r,q) * det2;gama2 = det(p2,r) * det2;Quote:People who will use your code in the future will thank youNo they won't, but at least they won't complain either :). I'm a fan of your blog by the way, kudos for thatQuote:Found this quote by Dmytry which sums it up nicelyThanks :) 0 Share this post Link to post Share on other sites 
 Prev 1 2 Next Page 1 of 2   Sign in to follow this   Followers 0 
 Go To Topic Listing Math and Physics Advertisement 
 Announcements Latest from GameDev.net - May 2018 Advertisement Popular Tags 2D 3D Advice Algorithm Animation C# C++ Character Concept Console Design DX11 GameMaker Gameplay General HTML5 Java Javascript Learning Mobile OpenGL PC SFX Unity Unreal Popular Now 10 Looking for People to Join Dev Team By Bread CollectorStarted Yesterday at 03:31 AM 17 How to improve FLEE in RPG videogames ?? By DasunSetStarted Thursday at 03:52 PM 9 13 years and counting: Sometimes I feel like I'm never going to finish my game By Martin BrentnallStarted Thursday at 02:12 PM 13 3D Best way to get center of scene or model which contains multiple primitives By recpStarted Thursday at 09:16 AM 41 I Know Nothing and I want to change that By HalpmelurngewdStarted Wednesday at 07:33 PM Advertisement Advertisement GameDev.net GameDev.net Articles GameDev.net Event Coverage GameDev.net Forums GameDev.net Blogs GameDev.net Gallery GameDev.net News GameDev.net Projects GDNet Chat All Activity Search In Everywhere This Forum This Topic More options... Find results that contain... Any of my search term words All of my search term words Find results in... Content titles and body Content titles only Home Forums Programming Math and Physics Can I replace the cross product with the wedge product? 
 
 
 × Existing user? Sign In Sign Up Browse Back Articles & Tutorials Back All Categories Audio Business Game Design Industry Programming Visual Arts Columns Back GameDev Unboxed Event Coverage Back All Events Game Developers Conference Power Up Digital Games Conference GameDev.Market Links News Podcasts Back All Podcasts Game Dev Loadout Archive Community Back Beginners Blogs Calendar Chat Forums Back All Forums Audio Business Game Design Programming Visual Arts Community Affiliates Topical Workshops Gallery Groups Projects Back All Projects Games Game Assets Game Mods Developer Tools Store Careers Back Contractors Hobby Projects Game Jobs Back Browse on GameDev.Jobs Post a Job Members Back Chat GDNet+ Membership Guidelines Leaderboard Online Users Awards Search Back All Activity My Activity Streams Back Latest Topics Featured Blogs Search var ipsDebug=false;var CKEDITOR_BASEPATH='//www.gamedev.net/applications/core/interface/ckeditor/ckeditor/';var ipsSettings={cookie_path:"/",cookie_prefix:"ips4_",cookie_ssl:true,upload_imgURL:"",message_imgURL:"",notification_imgURL:"",baseURL:"//www.gamedev.net/",jsURL:"//www.gamedev.net/applications/core/interface/js/js.php",csrfKey:"5825db5892979440fb1e44d3b980aee4",antiCache:"089133c5de",disableNotificationSounds:false,useCompiledFiles:true,links_external:true,memberID:0,analyticsProvider:"ga",viewProfiles:true,mapProvider:'google',mapApiKey:"AIzaSyAeT7tk3vnWWmbgVISkLpbhkQvekG19rHM",}; ips.setSetting('date_format',jQuery.parseJSON('"mm\/dd\/yy"'));ips.setSetting('date_first_day',jQuery.parseJSON('0'));ips.setSetting('remote_image_proxy',jQuery.parseJSON('1'));ips.setSetting('ipb_url_filter_option',jQuery.parseJSON('"none"'));ips.setSetting('url_filter_any_action',jQuery.parseJSON('"allow"'));ips.setSetting('bypass_profanity',jQuery.parseJSON('0'));ips.setSetting('emoji_style',jQuery.parseJSON('"native"'));ips.setSetting('emoji_shortcodes',jQuery.parseJSON('"1"'));ips.setSetting('emoji_ascii',jQuery.parseJSON('"1"'));ips.setSetting('emoji_cache',jQuery.parseJSON('"1"'));ips.setSetting('quickSearchDefault',jQuery.parseJSON('"all"'));ips.setSetting('quickSearchMinimum',jQuery.parseJSON('3'));ips.setSetting('quickSearchShowAdv',jQuery.parseJSON('true'));ips.setSetting('quickSearchIn',jQuery.parseJSON('"title"')); { "@context": "http://schema.org", "@type": "DiscussionForumPosting", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/", "discussionUrl": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/", "name": "Can I replace the cross product with the wedge product?", "headline": "Can I replace the cross product with the wedge product?", "text": "As you know the cross product is only defined for vectors in 3 and 7 dimensions. Now I would like to implement an analog to the cross product in 2 dimensions which produces a scalar as follows:\n\n(x0, y0) ^ (x1, y1) = x0.y1 - y0.x1 (where . is multiplication)\n\nSo I was thinking that since my place of work has opted to use ^ as a cross product, it seems quite elegant to instead redefine the ^ operator as the (Hodge dual of the) wedge product since this happens to be equivalent to the cross product in three dimensions. In other words:\n\n*(A^B) = A x B in three dimensions. (where * is the Hodge Dual operator, ^ is the wedge product and x is the cross product)\n\nAs far as I can tell this also does what I want it to in two dimensions (using this reference):\n\n*(A^B) = A0.B1 - A1.B0 in two dimensions\n\nQUESTION:\n1. So I had been thinking, is it permissible to replace our ^ operator with the Hodge Dual of a wedge product for vectors of all dimensions?\n\n2. In other words could I extend this operation in a useful manner to vectors of higher dimensions?\n\n3. And finally I suppose you could then write all *(A^B) in a matrix form? E.g. as for the 3D cross-product:\n\n\n [ 0 -A2 A1 ] [ B0 ]\nA x B = [ A2 0 -A0 ] * [ B1 ]\n [ -A1 A0 0 ] [ B2 ]\n\n\nUnfortunately I have some pressing deadlines so I can\u0027t spend too much time studying the math. Any commentary will be much appreciated and I apologize for any ignorance on my part! ;)\n", "dateCreated": "2009-01-24T04:21:47+0000", "datePublished": "2009-01-24T04:21:47+0000", "pageStart": 1, "pageEnd": 2, "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "interactionStatistic": [ { "@type": "InteractionCounter", "interactionType": "http://schema.org/ViewAction", "userInteractionCount": 3000 }, { "@type": "InteractionCounter", "interactionType": "http://schema.org/CommentAction", "userInteractionCount": 13 }, { "@type": "InteractionCounter", "interactionType": "http://schema.org/FollowAction", "userInteractionCount": 11 } ], "comment": [ { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=522079", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "dateCreated": "2009-01-24T04:21:47+0000", "text": "As you know the cross product is only defined for vectors in 3 and 7 dimensions. Now I would like to implement an analog to the cross product in 2 dimensions which produces a scalar as follows:\n\n(x0, y0) ^ (x1, y1) = x0.y1 - y0.x1 (where . is multiplication)\n\nSo I was thinking that since my place of work has opted to use ^ as a cross product, it seems quite elegant to instead redefine the ^ operator as the (Hodge dual of the) wedge product since this happens to be equivalent to the cross product in three dimensions. In other words:\n\n*(A^B) = A x B in three dimensions. (where * is the Hodge Dual operator, ^ is the wedge product and x is the cross product)\n\nAs far as I can tell this also does what I want it to in two dimensions (using this reference):\n\n*(A^B) = A0.B1 - A1.B0 in two dimensions\n\nQUESTION:\n1. So I had been thinking, is it permissible to replace our ^ operator with the Hodge Dual of a wedge product for vectors of all dimensions?\n\n2. In other words could I extend this operation in a useful manner to vectors of higher dimensions?\n\n3. And finally I suppose you could then write all *(A^B) in a matrix form? E.g. as for the 3D cross-product:\n\n\n [ 0 -A2 A1 ] [ B0 ]\nA x B = [ A2 0 -A0 ] * [ B1 ]\n [ -A1 A0 0 ] [ B2 ]\n\n\nUnfortunately I have some pressing deadlines so I can\u0027t spend too much time studying the math. Any commentary will be much appreciated and I apologize for any ignorance on my part! ;)\n", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388264", "author": { "@type": "Person", "name": "Ignifex", "image": "https://secure.gravatar.com/avatar/0c1d08c3bd37ec43057eea46c71a4cc2?d=https://www.gamedev.net/uploads/monthly_2017_08/I.png.22463edfebff9f0023d752c96bf12325.png", "url": "https://www.gamedev.net/profile/64103-ignifex/" }, "dateCreated": "2009-01-24T04:35:04+0000", "text": "The dual of a 2-blade in 3 dimenions results in a 1-blade (vector) perpendicular to this 2-blade (where the 2-blade represents a plane in euclidian space).n = (a ^ b)*This can easily be used in the same way for higher dimensions, but will not have the geometrical significance of a normal vector. Instead, the dual of a plane in 4D will result in another (dual)plane.In short, only the dual of a pseudoscalar results in a scalar. A pseudoscalar is a k-blade in a k-dimensional space (plane in 2D, sphere in 3D, hypersphere in 4D).The crossproduct only works for 3D (and for converted 2D).About the matrices, I\u0027m not sure it\u0027s that easy. I\u0027ve never looked into it.", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388269", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "dateCreated": "2009-01-24T05:15:10+0000", "text": "I\u0027m afraid most of that went over my head (I\u0027m sorry I have no experience with Clifford algebra), but I think I get what you\u0027re saying anyway, since I suspected as much. From here the 4d dual of a bi-vector is this:Dual(e31) = e1234 . e31 = e42which is still a bi-vector. (I hope I\u0027m making sense since I don\u0027t really know what I\u0027m talking about ;) )I guess I was trying to find a nice analog to the cross-product which is general enough to be meaningful for all dimensions but happens to give the determinant in two dimensions and the cross product in three dimensions... It seems inelegant to limit an operator to a finite number of dimensions. (Damn you Nature! :) )", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388278", "author": { "@type": "Person", "name": "rozz666", "image": "https://secure.gravatar.com/avatar/c45bb258c645bf6077d90dd78a517335?d=https://www.gamedev.net/uploads/monthly_2017_08/R.png.cdb0b475d6320ab092691dd49e8513f8.png", "url": "https://www.gamedev.net/profile/121697-rozz666/" }, "dateCreated": "2009-01-24T05:30:30+0000", "text": "The cross product is defined for n-dimensional space and you need n-1 vectors to calculate it. For 3D it\u0027s:\n [ i j k ]u (x) v = [ ux uy uz ] [ vx vy vz ]\nI\u0027m not sure it makes sense for 2D (I used the concept sometimes):(x)(u) = [ i j ] = [ uy, -ux ] [ ux uy ]\nFor 4D it\u0027s: [ i j k l ](x)(u, v, w) = [ ux uy uz uw ] [ vx vy vz vw ] [ wx wy wz ww ]\nAnd so on...", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388287", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "dateCreated": "2009-01-24T06:11:48+0000", "text": "Hi rozz, ah yes thanks I take your meaning! To give some context, I was previously looking at this thread.I\u0027m actually looking for an alternative operator to the cross-product that happens to suit my needs (I.e. an operator that operates on only two operands). The wedge product happens to do what I want for the 2D and the 3D case and looks a lot like the binary ^ operator. On the other hand combining three operands using ^ is not possible, so essentially I want to redefine my old cross-product ^ as a wedge-product ^. I\u0027m thinking if you want to retain the cross product, maybe you should define it as cross(x,y,z,...) to retain consistency across all dimensions.So I guess I\u0027m testing the water to see whether others think that it would be a good idea to redefine my ^ as a dual(wedge product). Unfortunately this dual wedge product doesn\u0027t seem to extend nicely past 3 dimensions :_(", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388389", "author": { "@type": "Person", "name": "yahastu", "image": "https://secure.gravatar.com/avatar/04239e2a7910dae523a9a98ab09834e3?d=https://www.gamedev.net/uploads/monthly_2017_08/Y.png.c4b2d6588a7a0b6a1859eb52abc20e23.png", "url": "https://www.gamedev.net/profile/120008-yahastu/" }, "dateCreated": "2009-01-24T09:32:13+0000", "text": "The cross product has a geometric meaning that is useful in 3 dimensions..what good is it for 2 or n-dimensions, whats the point?", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388417", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "dateCreated": "2009-01-24T10:42:46+0000", "text": "Well, the cross product is definitely useful in 2 dimensions: it gives you an orthogonal vector.The wedge product is also useful in 2 dimensions: it gives you the determinant of | A B | which is what I\u0027m using right now for triangle-triangle intersection.As for higher dimensions, who knows what it\u0027s useful for? For example, I used to think that eigen-vectors and eigen-values were useless too, but since then I\u0027ve discovered a multitude of uses for them. Admittedly I can\u0027t imagine a use for the 4d wedge product, but maybe someone will disagree with me?", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388443", "author": { "@type": "Person", "name": "Christer Ericson", "image": "https://secure.gravatar.com/avatar/69e9220d20e9cc7a3a124f0c59c5fce0?d=https://www.gamedev.net/uploads/monthly_2017_08/C.png.182a513ee27c96d86e0f90239905745f.png", "url": "https://www.gamedev.net/profile/66650-christer-ericson/" }, "dateCreated": "2009-01-24T11:38:24+0000", "text": "You might, but even so I would consider it bad for a number of reasons, including being overengineered and overly complex. (In fact, I consider overloading circumflex to be the cross product to be bad form, but that\u0027s a different discussion.)You are better off defining a normal cross product for your 3-vectors and a pseudo-cross product for your 2-vectors. People who will use your code in the future will thank you.\n", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388456", "author": { "@type": "Person", "name": "yahastu", "image": "https://secure.gravatar.com/avatar/04239e2a7910dae523a9a98ab09834e3?d=https://www.gamedev.net/uploads/monthly_2017_08/Y.png.c4b2d6588a7a0b6a1859eb52abc20e23.png", "url": "https://www.gamedev.net/profile/120008-yahastu/" }, "dateCreated": "2009-01-24T12:07:45+0000", "text": "Found this quote by Dmytry which sums it up nicely:", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" }, { "@type": "Comment", "url": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/?do=findComment\u0026comment=4388483", "author": { "@type": "Person", "name": "errantkid", "image": "https://secure.gravatar.com/avatar/80c33b5a72595157a2a8a217a7af3e38?d=https://www.gamedev.net/uploads/monthly_2017_08/E.png.01459fbeeb3a2f59b0378d51759cd762.png", "url": "https://www.gamedev.net/profile/146552-errantkid/" }, "dateCreated": "2009-01-24T12:47:55+0000", "text": "Thanks, I suspected that people might feel this way. It seems I\u0027m not the first person who has thought to do this either: threadMy problem is mainly that I want to write this kind of thing more elegantly:det1 = p1[0]*q[1]-q[0]*p1[1];gama1 = (p1[0]*r[1]-r[0]*p1[1])*det1;alpha1 = (r[0]*q[1] - q[0]*r[1])*det1;alpha1_legal = (alpha1\u0026gt;=0) \u0026amp;\u0026amp; (alpha1\u0026lt;=(det1*det1) \u0026amp;\u0026amp; (det1!=0));det2 = p2[0]*q[1] - q[0]*p2[1];alpha2 = (r[0]*q[1] - q[0]*r[1]) *det2;gama2 = (p2[0]*r[1] - r[0]*p2[1]) * det2;\nWhich is from Oren Tropp\u0027s triangle intersection algo but I guess I\u0027m stuck with it :) Perhaps I should just define a determinant function so thatdet1 = det(p1,q);gama1 = det(p1,r)*det1;alpha1 = det(r,q)*det1;alpha1_legal = (alpha1\u0026gt;=0) \u0026amp;\u0026amp; (alpha1\u0026lt;=(det1*det1) \u0026amp;\u0026amp; (det1!=0));det2 = det(p2,q);alpha2 = det(r,q) * det2;gama2 = det(p2,r) * det2;\nNo they won\u0027t, but at least they won\u0027t complain either :). I\u0027m a fan of your blog by the way, kudos for thatThanks :)\n", "mainEntityOfPage": "https://www.gamedev.net/forums/topic/522079-can-i-replace-the-cross-product-with-the-wedge-product/" } ] } { "@context": "http://www.schema.org", "@type": "WebSite", "name": "GameDev.net", "url": "https://www.gamedev.net/", "potentialAction": { "type": "SearchAction", "query-input": "required name=query", "target": "https://www.gamedev.net/search/?q={query}" }, "inLanguage": [ { "@type": "Language", "name": "English (USA)", "alternateName": "en-US" } ] } { "@context": "http://www.schema.org", "@type": "Organization", "name": "GameDev.net", "url": "https://www.gamedev.net/", "logo": "https://www.gamedev.net/uploads/themes/monthly_2017_04/gamedev-logo-2017-368x76.png.e986e41d566ff6c90485a5304985ed5f.png", "address": { "@type": "PostalAddress", "streetAddress": "", "addressLocality": null, "addressRegion": null, "postalCode": null, "addressCountry": null } } { "@context": "http://schema.org", "@type": "BreadcrumbList", "itemListElement": [ { "@type": "ListItem", "position": 1, "item": { "@id": "https://www.gamedev.net/forums/", "name": "Forums" } }, { "@type": "ListItem", "position": 2, "item": { "@id": "https://www.gamedev.net/forums/forum/4-programming/", "name": "Programming" } }, { "@type": "ListItem", "position": 3, "item": { "@id": "https://www.gamedev.net/forums/forum/7-math-and-physics/", "name": "Math and Physics" } } ] } { "@context": "http://schema.org", "@type": "ContactPage", "url": "https://www.gamedev.net/contact/" } Important Information By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.   I accept Participate in the game development conversation and more when you create an account on GameDev.net! Sign me up!