Unit Vectors - Normalizing ใช้ python และ numpy

Unit Vectors – Normalizing ใช้ python และ numpy

14 มกราคม 2010

Share 

ก่อนที่เราจะ normalize vector ได้ เราต้องหา norm ( magnitude หรือ ขนาด) ของมันก่อน

ซึ่งมันหาได้โดยการ ถอด Square root ของ ผลบวกกำลังสองครับ (sumsquare)
length = sqrt((ax * ax) + (ay * ay) + (az * az))
length = sqrt(9 + 1 + 4) = 3.742
ซึ่ง 3.742 จะเป็น ขนาดของ Vector [1,2,3] ครับ
ถ้าจะ normalize  vector  นี้ก็เอา magnitude [...]

Get Adobe Flash playerPlugin by wpburn.com wordpress themes