Topic: Vector Math  (Read 3375 times)

0 Members and 1 Guest are viewing this topic.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Vector Math
« on: September 18, 2010, 06:34:17 am »
Sorry guys, it's back to high school...

(aside: LaTex or jsMath Plugin for SMF? oh wait, we do have something... perhaps it is time to play with it - no back to math... um.. wait it is good motivation, figure it out then post it nice... some will know what I'm talking about...)

Um anyway - I have been given conflicting definitions of

A) dot product vs cross product

and

B) inner product vs outer product

I basically have a good handle on A) , but I am confused as to how that relates to B).

I'm betting a few here will know. (it should be fresh in SFHQ's mind) I think it comes down to transformed vectors somehow and simple conventions in writing and thinking about them.

(aside: qtOctave)

There are differences between how they write them in Math, Chemistry and Physics.... dammit they are vectors, it is not that complicated. We need some conventions on this beyond those within disciplines, things have come that far... perhaps there is a cross-discipline standard that I am not aware of?

Anyway, if someone could definitely clarify the inner vs outer product and how that relates to the dot product vs the cross product for me that would be great. Oh, and how to find the projection of one vector onto another (I expect it is a related question). I should remember this...

Perhaps this is a question for the modelers?

Offline Lieutenant_Q

  • Lt. Commander
  • *
  • Posts: 1669
  • Gender: Male
Re: Vector Math
« Reply #1 on: September 18, 2010, 10:37:42 am »
Its been way too long since I've done Vector math, I'll think on it and see if I can come up with it.  But I did want to pass along a little tidbit I got from my psycho Chem Teacher in College (in between her constant, 'oh I don't need to explain this to you, its cake' comments).  Probably about the only thing I ever learned from her...

It is indeed the same between Physics, Calculus and Chemistry.  But they annotate it differently specifically to be contrary.  Almost as if they don't want to admit (Chemists and Physicists) that their work is simply a derivative application of Calculus.
"Your mighty GDI forces have been emasculated, and you yourself are a killer of children.  Now of course it's not true.  But the world only believes what the media tells them to believe.  And I tell the media what to believe, its really quite simple." - Kane (Joe Kucan) Command & Conquer Tiberium Dawn (1995)

Offline FCM_SFHQ_XC

  • There is life outside of Windows..
  • Administrator
  • Lt. Commander
  • *
  • Posts: 2267
  • Gender: Male
  • Starbase Atlantis [X-refit]
    • 9th Fleet
Re: Vector Math
« Reply #2 on: September 18, 2010, 06:40:16 pm »
I havent delt with inner product and outer product much, but I looked it up in my Mathematical Methods of Physical Sciences book I used last year in Physics 3900 and in short this is what it has on it
for Dot Product vs. Inner product they are the SAME except that inner product has one extra feature that associates each pair of vectors in the space with a scalar quantity known as the inner product of the vectors.

but it otherwise the same

for Outer product, well in shorta is also known as the Tensor product in Cartesian Tensors
so if they're confusing outer product vs cross product then there's a bit of an issue there because those are only similar in matrix form. The result of a outer product is a matrix, while a cross product can be put into matrix form for easier computation for a cross product.


Vector Projection is just
(A {dot} B) / |B^2| * B to find the new vector C projected on B
*bolded letters indicate vector

hope that helps, its actually been a bit since Ive last used vector projection in physics
Starfleet Headquarters out.

Fleet Commodore, XenoCorp, ISC Fleet.

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #3 on: September 19, 2010, 05:22:00 am »
...so if they're confusing outer product vs cross product then there's a bit of an issue there because those are only similar in matrix form. The result of a outer product is a matrix, while a cross product can be put into matrix form for easier computation for a cross product.

I think that was exactly the distinction I needed. Thanks SFHQ! :thumbsup:

One of my chem profs said they were not the same (but not how) and my matrix theory prof said they are (effectively). I was left wondering.

(jsMath coming soon to an SMF/Wiki install near you! ;) )

edit: installed ... here's the formula for the projection of u onto v (jsmath block display):
[mathb]\frac{\mathbf{u}\cdot\mathbf{v}}{\Vert{v}\Vert^2}\mathbf{v}[/mathb]

...hmmm but a vertical scroll bar appears on the post in IE... not a big deal, but it would be nice to get rid of... i wonder if the inline form causes it too? It does not appear in the canada-east theme... hmmm...

let's try the inline formula too: [math]\frac{\mathbf{u}\cdot\mathbf{v}}{\Vert{v}\Vert^2}\mathbf{v}[/math] to see how it looks.
« Last Edit: September 19, 2010, 06:42:53 am by Bonk »

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Vector Math
« Reply #4 on: September 19, 2010, 11:44:36 am »
Vert scrollbar appears in Firefox, too.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #5 on: September 19, 2010, 03:24:58 pm »
I wonder if it does it if there is no quote in the post... like this one

[mathb]\frac{\mathbf{u}\cdot\mathbf{v}}{\Vert{v}\Vert^2}\mathbf{v}[/mathb]

Seems not. Interesting. Be nice to figure that out.

Next, further on this subject, transposed vectors and how they relate to the calculation of inner and outer products. (and why do we do this in chemistry but not in math?) I just don't see the point of it. This whole column vector vs row vector thing... makes no sense.

I think I need to work out all my own definitions of this stuff and then look at how each discipline expresses it.

They must be working up to something. This is what always happens to me in math. Years later I find out the overlying math that defines the underlying math that I struggled with for years, then all of a sudden it makes sense. (e.g. teaching conic sections without integral calculus, pure idiocy - why would anyone do something so cruel to a child... that is just mean.)
« Last Edit: September 19, 2010, 03:40:50 pm by Bonk »

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: Vector Math
« Reply #6 on: September 19, 2010, 03:33:13 pm »
Looks like something is off with the .inner class
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #7 on: September 19, 2010, 03:48:01 pm »
Thankya Sir! Added a 1em padding to the bottom and that seems to do the trick. A little extra padding on the bottom is always good. ;)

P.S. I just realised the common wasp is a remarkably beautiful creature.
« Last Edit: September 19, 2010, 04:04:03 pm by Bonk »

Offline FCM_SFHQ_XC

  • There is life outside of Windows..
  • Administrator
  • Lt. Commander
  • *
  • Posts: 2267
  • Gender: Male
  • Starbase Atlantis [X-refit]
    • 9th Fleet
Re: Vector Math
« Reply #8 on: September 19, 2010, 04:02:02 pm »
ahh yes that looks much nicer, glad it helped, I got tons of extra stuff in my Physics Math book so should you come across any other things most likely my book will discuss it lol
Starfleet Headquarters out.

Fleet Commodore, XenoCorp, ISC Fleet.

Offline Capt. Mike

  • Live from Granpa's Grotto
  • Captain
  • *
  • Posts: 6616
  • Gender: Male
Re: Vector Math
« Reply #9 on: September 24, 2010, 02:36:03 am »
You can always pop over to here  http://www.pmelforum.com/index.php  and get a copy of the Metrology Handbook (amongst other things) since metrology is the science of calibration, and that's what I do.


Mike
Summum ius summa iniuria.

The more law, the less justice.

Cicero, De Officiis, I, 33

"It doesn't, and you can't, I won't, and it don't
it hasn't, it isn't, it even ain't, and it shouldn't
it couldn't"
FZ, 1974

My chops were not as fast...[but] I just leaned more on what was in my mind than what was in my chops.  I learned a long time ago that one note can go a long way if it's the right one, and it will probably whip the guy with twenty notes.
 --Les Paul

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #10 on: September 25, 2010, 09:57:33 am »
I will definitely check that stuff over Capt. Mike. Thanks!

I have found a newer javascript math library MathJax and managed to adapt the TiddlyWiki jsMath plugin to it:

http://myweb.dal.ca/haines/#PluginMathJax

...but it has a bad bug in IE8 that hopefully I can fix - it does work in IE9 though (firefox and iron seem fine).

So I better get going on the actual homework! ;)  I want to use this to make some good notes on chemometrics after I nail most of it down. I have to use play as a motivator I think.

I have an idea for a tiddler->pdf utility. Might be possible...

I have stuck with jsMath here though as it is half the size... but really only for Nemesis... I'd be curious to see his input on the a comparison of MathJax vs JsMath performance and behaviour over dialup, the two example pages would probably be best:

http://www.mathjax.org/demos/tex-samples/ (note - has wordpress overhead, bear that in mind)
vs
http://www.math.union.edu/~dpvc/jsMath/examples/examples.html

Next in this area, MathJax and MediaWiki (which way I go kinda depends on Nemesis' observations though)
« Last Edit: September 29, 2010, 12:35:13 pm by Bonk »

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #11 on: September 29, 2010, 12:41:18 pm »
I've updated my TiddlyWiki Mathjax plugin (pretty much bug free now) and have moved on to something equally interesting:

http://logand.com/sw/wps/index.html

Most cool.  8)

I really should just be doing my homework, but all this will add up to something useful eventually. I'm seeing the applications of linear algebra and matrix theory in gaming blazing through almost as strongly as chemometrics.

I wonder if anyone has started a matlab interpreter in js? There is this trend of implementing other languages on top of javascript lately, and while kind of inefficient, I think it has merit, considering the content that it could provide the "web 2.0-y - ajaxy" internet of today. All the old farts could dump their work in easily... The merit of the concept is debated, but I am behind it where it makes sense.

Hmmm no matlab interpreter in js at first glance. Math thesis anyone? Would it make sense? Would it be possible? And perhaps most importantly - would you get sued?

Second math work proposal - an algorithm, in any language, for finding valid substitutions in systems of linear equations. If a computer could do that on-the-fly.... look out. Would be most helpful for brute force AI by multivariate data analysis.  (two of my theories in one - actually, it would reduce the brute-forcyness of it - enough to do it in real time? Imagine games with "real-time" adaptive "AI" (way better than what we have now) and "real-time" raytraced graphics. Whoah. Beware the machine indeed.)

I can almost see how to implement valid lead-tracking in drones within SFC rules. Calc it out as it it were real, then restrict it to quantised SFC hexmap sideslip and close-the-range rules as close as possible in a continuum. Maybe this is what they in fact did? Sounds kinda close to the result we see in SFC, but it is not quite right.

(I think this is how SFC is designed... done on a continuum to approximate the original quantisation of the paper game  - I wonder what would happen if you reversed the approach hand did it all to the letter of the paper rules (hideous math) and then averaged the result out over the second and millisecond timescales of SFC for presentation to the users - could it work at all? would  there be any benefit?)

edit: I think I have a name for my TiddlyWiki Plugins package. It will show school spirit, but kind of depends on getting WPS working. ;)
- I'm going to need a good chemical structures js library too. An initial search was confusing...

I have noticed that the popularity of js implementations has grown in part due to the iPhone.
« Last Edit: September 29, 2010, 02:48:56 pm by Bonk »

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #12 on: September 29, 2010, 03:03:01 pm »
Oh schweet... : http://web.chemdoodle.com/installation.php   8)  :rwoot:

Now where is that matlab interpreter?

Offline Capt. Mike

  • Live from Granpa's Grotto
  • Captain
  • *
  • Posts: 6616
  • Gender: Male
Re: Vector Math
« Reply #13 on: September 30, 2010, 05:33:08 am »
Why do I discover this stuff just before I go to work....

Have fun

Mike
Summum ius summa iniuria.

The more law, the less justice.

Cicero, De Officiis, I, 33

"It doesn't, and you can't, I won't, and it don't
it hasn't, it isn't, it even ain't, and it shouldn't
it couldn't"
FZ, 1974

My chops were not as fast...[but] I just leaned more on what was in my mind than what was in my chops.  I learned a long time ago that one note can go a long way if it's the right one, and it will probably whip the guy with twenty notes.
 --Les Paul

Offline Bonk

  • Commodore
  • *
  • Posts: 13298
  • You don't have to live like a refugee.
Re: Vector Math
« Reply #14 on: October 04, 2010, 12:58:26 pm »
Check this out:

The Sage Notebook

Far effing out man. Really far out. I love it. I'm working with qtOctave and Sage Notebook alongside Matlab. I have not found any major incompatibilities with either so far, but I have a ways to go to see how well they actually compare in the advanced functions and scripting.

Perhaps I shall work out some collision detection/prediction stuff and publish it there as a start on my long time SFC bitch on (anti)drone AI. ;)
« Last Edit: October 04, 2010, 01:15:31 pm by Bonk »