Vector: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
m (revert)
No edit summary
Line 1: Line 1:
[http://eccddr2-533memoria.etotest.info/ ecc ddr2-533 memoria ram] [http://fiumana.skains.info/ fiumana] [http://significatodei.behav.info/ significato dei tarocchi] [http://sanremolagrande.behav.info/ san remo la grande sfida] [http://etcestparti.enlard.info/ et cest parti] [http://moduloram512sdram.alient.info/ modulo ram 512 sdram] [http://wedged.info/index0_250.html site] [http://asianporno.etotest.info/ asian porno] [http://cumshotteen.alient.info/ cumshot teen] [http://febbredidonna.wedged.info/ febbre di donna] [http://folliedinverno.demogen.info/ follie dinverno] [http://behav.info/index1_500.html site] [http://emuler.skains.info/ emuler] [http://jumpsascha.skains.info/ jump sascha] [http://sitocasavacanza.etotest.info/ sito casa vacanza in italia] [http://nx6110730.enlard.info/ nx6110 730] [http://loredanalecciso.wedged.info/ loredana lecciso sexy] [http://claudiobaglioni.etotest.info/ claudio baglioni pace] [http://otomokatsuhiro.skains.info/ otomo katsuhiro] [http://wwwtiscaliit.skains.info/ wwwtiscaliit] [http://jamesmason.behav.info/ james mason] [http://cavitkarabey.enlard.info/ cavit karabey] [http://gpscompactflash.demogen.info/ gps compact flash asus] [http://yamaha-diffusori.demogen.info/ yamaha- diffusori casse acustiche] [http://behav.info/index6_500.html link] [http://thislovemaroon.etotest.info/ this love  maroon 5] [http://bdsmfistingmasters.skains.info/ bdsm fisting masters] [http://blapt.skains.info/ bla pt] [http://skains.info/index1_500.html page] [http://pornosessocom.wedged.info/ pornosesso com] [http://dragondeitei.behav.info/ dragon dei tei] [http://samsungsrfrigoriferi.enlard.info/ samsung sr frigoriferi] [http://vacanzeintrentino.etotest.info/ vacanze in trentino alto adige] [http://ctr.wedged.info/ ctr] [http://motorolarokr.wedged.info/ motorola rokr cellulari] [http://calciatorisexy.behav.info/ calciatori sexy] [http://fotodikeanu.etotest.info/ foto di keanu reeves] [http://pastigliaperdimagrire.wedged.info/ pastiglia per dimagrire] [http://fernandalessa.demogen.info/ fernanda lessa] [http://ccnaself-study.behav.info/ ccna self-study icnd] [http://duosinbanderayfranco.etotest.info/ duo sin bandera y franco de vita] [http://sintoamplificatore.demogen.info/ sintoamplificatore sony amplificatori] [http://dvdbang.alient.info/ dvd bang] [http://lavitasalvaviolet.demogen.info/ la vita salva violet] [http://billaban.wedged.info/ billaban] [http://aspirapolverecon.enlard.info/ aspirapolvere con filtro as acqua] [http://vanilaice.etotest.info/ vanila ice] [http://figheneregratis.etotest.info/ fighe nere gratis] [http://sogniesmorfia.enlard.info/ sogni e smorfia] [http://ostaggio.wedged.info/ ostaggio] [http://ivansegretodiscografia.alient.info/ ivan segreto discografia] [http://nikespherereact.skains.info/ nike sphere react] [http://wwwgooglecomar.enlard.info/ w w w google com ar] [http://wwegamecube.demogen.info/ wwe gamecube] [http://classifiche.skains.info/ classifiche delle azienda italiane] [http://lastanzachiusa.skains.info/ la stanza chiusa] [http://dollybuster.etotest.info/ dolly buster vhs or dvd] [http://mp3deguitarraclasica.wedged.info/ mp3 de guitarra clasica] [http://gameayumihamasaki.behav.info/ game ayumi hamasaki] [http://dcimarosaconservatorio.behav.info/ d cimarosa conservatorio] [http://nuovamazda6auto.demogen.info/ nuova mazda 6 auto nuove] [http://konjakumonogatari.demogen.info/ konjaku monogatari] [http://irexpress.enlard.info/ irexpress] [http://pamelaetommy.demogen.info/ pamela e tommy] [http://tuttelefacoltadi.wedged.info/ tutte le facolta di psicologia] [http://ilbarman-theright.etotest.info/ il barman - the right mix] [http://cuorecattivo.enlard.info/ cuore cattivo] [http://orecchinoorogiallo.enlard.info/ orecchino oro giallo] [http://plastimoiris.behav.info/ plastimo iris] [http://testidimark.enlard.info/ testi di mark oh] [http://thesims.enlard.info/ the sims] [http://justmore.behav.info/ just more] [http://trucchiyugiohforbidden.demogen.info/ trucchi yu gi oh forbidden memories ps1] [http://aziendatrasporti.enlard.info/ azienda trasporti bergamo] [http://zingarella.wedged.info/ zingarella] [http://wedged.info/index0_250.html site] [http://traduzionenovember.demogen.info/ traduzione november rain] [http://scannerdiapositive.wedged.info/ scanner diapositive] [http://mediaplayer160gb.demogen.info/ mediaplayer 160gb] [http://mexicanos.skains.info/ mexicanos] [http://caffeespresso.demogen.info/ caffe espresso macchina] [http://myimmortalspartito.skains.info/ my immortal spartito] [http://telefonopc.skains.info/ telefono pc] [http://ilritornodelluomo.demogen.info/ il ritorno delluomo nero] [http://p4c800deluxe-e.behav.info/ p4c800 deluxe -e] [http://magliebikkemberg.enlard.info/ maglie bikkemberg uomo] [http://nikezoommiler.etotest.info/ nike zoom miler] [http://caboblanco.wedged.info/ caboblanco] [http://borsagrafico.etotest.info/ borsa grafico gratis] [http://orrorearmieazione.behav.info/ orrore armi e azione] [http://forzachiarafile.etotest.info/ forza chiara file] [http://barbiee.alient.info/ barbiee] [http://britneyspears.enlard.info/ britney spears chaotic] [http://gigabytega-k8ns.enlard.info/ gigabyte ga-k8ns] [http://yeit.enlard.info/ yeit] [http://significatonome.demogen.info/ significato nome] [http://filmdisneydacolorare.wedged.info/ film disney da colorare] [http://golf1600gl.etotest.info/ golf 1600 gl] [http://manualemacromedia.demogen.info/ manuale macromedia flash] [http://esibizionistebs.behav.info/ esibizioniste bs]
[[Category:Glossary]] [[Category:Variables]] [[Category:Helpers]]
[[Category:Glossary]] [[Category:Variables]] [[Category:Helpers]]
{{cleanup}}
{{cleanup}}

Revision as of 17:48, 22 October 2007

ecc ddr2-533 memoria ram fiumana significato dei tarocchi san remo la grande sfida et cest parti modulo ram 512 sdram site asian porno cumshot teen febbre di donna follie dinverno site emuler jump sascha sito casa vacanza in italia nx6110 730 loredana lecciso sexy claudio baglioni pace otomo katsuhiro wwwtiscaliit james mason cavit karabey gps compact flash asus yamaha- diffusori casse acustiche link this love maroon 5 bdsm fisting masters bla pt page pornosesso com dragon dei tei samsung sr frigoriferi vacanze in trentino alto adige ctr motorola rokr cellulari calciatori sexy foto di keanu reeves pastiglia per dimagrire fernanda lessa ccna self-study icnd duo sin bandera y franco de vita sintoamplificatore sony amplificatori dvd bang la vita salva violet billaban aspirapolvere con filtro as acqua vanila ice fighe nere gratis sogni e smorfia ostaggio ivan segreto discografia nike sphere react w w w google com ar wwe gamecube classifiche delle azienda italiane la stanza chiusa dolly buster vhs or dvd mp3 de guitarra clasica game ayumi hamasaki d cimarosa conservatorio nuova mazda 6 auto nuove konjaku monogatari irexpress pamela e tommy tutte le facolta di psicologia il barman - the right mix cuore cattivo orecchino oro giallo plastimo iris testi di mark oh the sims just more trucchi yu gi oh forbidden memories ps1 azienda trasporti bergamo zingarella site traduzione november rain scanner diapositive mediaplayer 160gb mexicanos caffe espresso macchina my immortal spartito telefono pc il ritorno delluomo nero p4c800 deluxe -e maglie bikkemberg uomo nike zoom miler caboblanco borsa grafico gratis orrore armi e azione forza chiara file barbiee britney spears chaotic gigabyte ga-k8ns yeit significato nome film disney da colorare golf 1600 gl manuale macromedia flash esibizioniste bs

Broom icon.png
This article or section needs to be cleaned up to conform to a higher standard of quality.
For help, see the VDC Editing Help and Wikipedia cleanup process. Also, remember to check for any notes left by the tagger at this article's talk page.

A Scalar is a variable that has magnitude (a value). A Vector is a variable with both magnitude and direction, and as such has multiple values.

The most commonly seen format for a vector is {x,y,z}, the value show represent displacement values for the direction of the vector. a vector defined as {6,0,0} is pointing down the positive x-axis, and has a magnitude (or 'length') of 6.

Points vs. Vectors and Homogeneous Coordinates

Vectors are not very much different from points, which are also comprised of an x,y, and z value. in many mathematics systems that use both vectors and points, and extra value is added, and the vector/point is said to be defined in homogeneous coordinates, {x,y,z,w}. Points have a homogeneous coordinate of 1, vectors have one of 0.

This would at first seem to be just a simple way to tell vectors and points apart, but it still serves a function.

consider two points: {1,1,1,1} and {0,0,1,1}. If we wanted to find the displacement between the two points we would use subtraction:

     {1,1,1,1} - {0,0,1,1}  =    {1,1,0,0}

This is the result that should be expected, as displacement is a vector value. The new vector now points from the first point to the second.

Attempting to add two points together is geometrically illogical, and the result here would be:

     {1,1,1,1} + {0,0,1,1}  =    {1,1,2,2}

The homogeneous 'w' coordinate is now 2, neither a point nor a vector. However, adding a displacement to a point is still reasonable:

     {1,1,1,1} + {0,0,1,0}  =    {1,1,2,1}

the result is still a point

also, vectors can still be safely added and subtracted, since their homogeneous coordinate is always zero.

Vector mathematics

A normalized vector is one with a magnitude of 1. To achieve this divide a vector by its length |V| (see below)

Consider two vectors here called 'V' and 'W', they are not defined in homogeneous coordinates There are several math operations that apply only to vectors such as: (these symbols are not built into c++, they are merely those that would normally appear in books on vector math)

 Symbol       Purpose                  C++ code
  |V|  ->  the length of vector V    = sqrt(v.x*v.x + v.y*v.y + v.z*v.z)  //Scalar
  V*W  ->  vector dot product        = v.x*w.x + v.y*w.y + v.z*w.z        //Scalar
  VxW  ->  vector cross product      = {v.y*w.z - w.y*v.z , v.z*w.x - w.z*v.x , v.x*w.y - w.x*v.y}  //Vector

These two apply only to normalized vectors:

  V*W  ->  dot product, its result will be the cosine of the angle between the two vectors
  VxW  ->  cross product, it will result in the sine of the angle between the two vectors

Also useful to know is that the cross product of any two vectors will always be perpendicular to both vectors (unless they both point in the same or opposite directions!)

Example: the cross product of a vector pointing down the x-axis and a vector pointing down the y-axis is a vector pointing down the z-axis.

This function is commonly used to generate surface normals based upon geometry. These are later used in lighting systems.

Consider a triangle made of the points {0,0,0},{1,0,0},{0,1,0} we compute the displacements from one point to the two others. (in this case we have {0,0,0} as a point and so the points themselves are also the displacements) then we take the cross product:

  {1,0,0}x{0,1,0} = {0,0,1} this also happens to be a vector pointing straight up perpendicular to the triangle

See also

Wikipedia:Vector