Vector: Difference between revisions

From Valve Developer Community
Jump to navigation Jump to search
(revert)
mNo edit summary
Line 1: Line 1:
[http://www.redacademica.edu.co/manejocorreo/Cliente/cache/wvkrje.html sacred cow] [http://tch-voyages.com/documents/prague/896/nlqacf.html nhat hao] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/pnojxh.html museum internship new york city] [http://asie-voyages.com/upload/images/lens/ulotwa.html east central oklahoma football] [http://indianaoutfitters.com/s/info/tmp/joahil.html key exchange play] [http://asie-voyages.com/upload/images/lens/upalru.html she knows who she is site myspace.com] [http://indianaoutfitters.com/s/info/tmp/csreek.html most popular search terms] [http://www.lewakins.com/sr/images/ngcopw.html should smoking be allowed in public place] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/fhoowh.html voip bandwidth calculations] [http://xuccco.org/themes/AT-Green3/ddxqpt.html activation code free window xp] [http://www.lewakins.com/sr/images/ewdvcf.html statewide criminal record check] [http://tch-voyages.com/documents/prague/896/dwdqcj.html jumbo records] [http://tch-voyages.com/documents/prague/896/rotpue.html no audio sound to my computer] [http://asie-voyages.com/upload/images/lens/qcdasm.html auction house england] [http://www.biblored.org.co/agenda_actividades/programas/images/neljpl.html jeff] [http://talentmodeles.com/mannequin/images/cache/pdegmq.html im going] [http://panties-pictures.com/free/lib/temp/hfvffu.html us army pt scores] [http://coastguard.gov.ph/content.old/license/nisesd.html association ga realtor] [http://www.biblored.org.co/agenda_actividades/programas/images/svvsln.html tcs address] [http://lumayagrealty.com/catalog/images/pics/gwwkwh.html matins du monde] [http://lumayagrealty.com/catalog/images/pics/mqexgm.html martin lewis money saving] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/rxjhpg.html lyrics planet rock] [http://indianaoutfitters.com/s/info/tmp/lbqmet.html active in usa volcano] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/lhuofk.html racing car sales] [http://panties-pictures.com/free/lib/temp/orloae.html ventas al detalle] [http://roycemotor.com/carpics/cache/pcruop.html preparing for the sat] [http://asie-voyages.com/upload/images/lens/iqnpen.html shop n go] [http://xuccco.org/themes/AT-Green3/hrdsvk.html news panama city] [http://lumayagrealty.com/catalog/images/pics/mmdgoj.html information technology employment agency] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/ecvujd.html vw seat fire] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/acnfrs.html samba music mp3] [http://talentmodeles.com/mannequin/images/cache/vsnulf.html lemon aid com] [http://smallbizbohol.com/democatalog/images/baner/tufwws.html top 20 singles in the uk] [http://xuccco.org/themes/AT-Green3/ttgfcx.html lyric man piano] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/eqswpl.html pocket wizard review] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/julfvu.html official nfl jersey] [http://xuccco.org/themes/AT-Green3/fqoxup.html which broadband] [http://panties-pictures.com/free/lib/temp/jfncsv.html sprint car builder] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/egfisq.html personal hygiene when handling food] [http://panties-pictures.com/free/lib/temp/hckkbj.html jay z linkin park mp3] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/anthkb.html using tapi] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/srlqak.html independent living centers california] [http://roycemotor.com/carpics/cache/ijnkio.html st. leos university florida] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/lqwrib.html interracial slut teen] [http://www.biblored.org.co/agenda_actividades/programas/images/huqrui.html pillow talk is extra] [http://coastguard.gov.ph/content.old/license/bbgwmm.html italian soccer standing] [http://tarsierfoundation.org/content/license/fberis.html missouri construction jobs] [http://ankelia-nature.com/catalogues/catalogues/eivuiu.html vintage 1930s clothes] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/ltnhul.html md taxes status] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/dkbuje.html mosaic store tile] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/ekprwq.html new york city marketing firm] [http://asie-voyages.com/upload/images/lens/ocgmii.html mindfulness group] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/nwqpmd.html sponge bob backgrounds] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/kdsfkr.html old spanish movies] [http://www.youthfitnesssolutions.com/FTP1/page9/fgxisu.html entrepreneur make money] [http://asie-voyages.com/upload/images/lens/wjlsrh.html 446th airlift wing] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/denlrq.html san antonio obituary] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/itdtec.html no swearing] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/ojqqfk.html in situ definition science] [http://www.norcab.com.au/joeavatiforum/templates/cache/ftiimk.html y que los feliz] [http://www.lewakins.com/sr/images/qfpvtc.html the body by stephen king notes] [http://www.redacademica.edu.co/manejocorreo/Cliente/cache/xkicki.html viajante] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/mngpoj.html the grudge halloween] [http://hoosierfishing.com/phpBB/images/avatars/avatar/guvijr.html acetic acid and calcium carbonate] [http://roycemotor.com/carpics/cache/hxubut.html remax properties inc.] [http://ankelia-nature.com/catalogues/catalogues/nboqsb.html wen power] [http://smallbizbohol.com/democatalog/images/baner/rleutu.html utada hikaru picture] [http://coastguard.gov.ph/content.old/license/vpvglr.html i loved lyric] [http://smallbizbohol.com/democatalog/images/baner/sidhhc.html shortcut bar replacement] [http://www.lewakins.com/sr/images/ktdvpr.html ecommerce credit card processing] [http://indianaoutfitters.com/s/info/tmp/rboutn.html ac hour meter] [http://tch-voyages.com/documents/prague/896/xajdnx.html if god made you lyrics] [http://roycemotor.com/carpics/cache/uemnwt.html ergonomics exercises] [http://www.lewakins.com/sr/images/mttkac.html text books for college] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/oedooh.html extended laptop battery life] [http://www.biblored.org.co/agenda_actividades/programas/images/ckwmcw.html neurontin use] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/cvwult.html tow ropes] [http://www.hdac.org/hdfaq/faq/abbqfr.html top black university] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/suemtr.html the country furniture collection] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/umhkwl.html screwdriver types] [http://panties-pictures.com/free/lib/temp/utukhl.html access deleting denied folder] [http://xuccco.org/themes/AT-Green3/vivrvh.html marvel hair schools] [http://tch-voyages.com/documents/prague/896/udrlrf.html toilet sign] [http://xuccco.org/themes/AT-Green3/mcscgi.html window 2000 hardware requirement] [http://ankelia-nature.com/catalogues/catalogues/xrvlnc.html porn blocking software] [http://xuccco.org/themes/AT-Green3/djqjlj.html music jamming] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/dwqwko.html pocket wizard review] [http://tch-voyages.com/documents/prague/896/jdflbx.html 1903 ford model] [http://tarsierfoundation.org/content/license/ncphns.html toxic substances control act of 1976] [http://xuccco.org/themes/AT-Green3/exgpvn.html java chatroom download] [http://cvscaft-tcc.edu.ph/gallery/uploads/cache/gsuqqw.html auction car dealer california] [http://bluespringsbmx.com/4IMAGES/data/media/10/tmp/kdcuta.html volkswagen customer service complaints] [http://www.biblored.org.co/agenda_actividades/programas/images/tghnli.html eclipse compiler for java] [http://www.biblored.org.co/agenda_actividades/programas/images/mdndan.html agent alabama columbus estate real] [http://talentmodeles.com/mannequin/images/cache/emtlle.html vehicle dynamics] [http://hoosierfishing.com/phpBB/images/avatars/avatar/foxvjn.html password to folder] [http://indianaoutfitters.com/s/info/tmp/orenlo.html address data entry standards] [http://panties-pictures.com/free/lib/temp/fbceee.html africa elizabeth port] [http://www.sedbogota.edu.co/FINANCIERA/temp/tmp/rekcqr.html area de perfil tarea y] [http://tarsierfoundation.org/content/license/gtuaiq.html promotional products in australia]
[[Category:Glossary]] [[Category:Variables]] [[Category:Helpers]]
[[Category:Glossary]] [[Category:Variables]] [[Category:Helpers]]
{{cleanup}}
{{cleanup}}

Revision as of 05:52, 10 November 2007

sacred cow nhat hao museum internship new york city east central oklahoma football key exchange play she knows who she is site myspace.com most popular search terms should smoking be allowed in public place voip bandwidth calculations activation code free window xp statewide criminal record check jumbo records no audio sound to my computer auction house england jeff im going us army pt scores association ga realtor tcs address matins du monde martin lewis money saving lyrics planet rock active in usa volcano racing car sales ventas al detalle preparing for the sat shop n go news panama city information technology employment agency vw seat fire samba music mp3 lemon aid com top 20 singles in the uk lyric man piano pocket wizard review official nfl jersey which broadband sprint car builder personal hygiene when handling food jay z linkin park mp3 using tapi independent living centers california st. leos university florida interracial slut teen pillow talk is extra italian soccer standing missouri construction jobs vintage 1930s clothes md taxes status mosaic store tile new york city marketing firm mindfulness group sponge bob backgrounds old spanish movies entrepreneur make money 446th airlift wing san antonio obituary no swearing in situ definition science y que los feliz the body by stephen king notes viajante the grudge halloween acetic acid and calcium carbonate remax properties inc. wen power utada hikaru picture i loved lyric shortcut bar replacement ecommerce credit card processing ac hour meter if god made you lyrics ergonomics exercises text books for college extended laptop battery life neurontin use tow ropes top black university the country furniture collection screwdriver types access deleting denied folder marvel hair schools toilet sign window 2000 hardware requirement porn blocking software music jamming pocket wizard review 1903 ford model toxic substances control act of 1976 java chatroom download auction car dealer california volkswagen customer service complaints eclipse compiler for java agent alabama columbus estate real vehicle dynamics password to folder address data entry standards africa elizabeth port area de perfil tarea y promotional products in australia

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