Unit Vectors – Normalizing ใช้ python และ numpy
- by Nat
ก่อนที่เราจะ 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 ไปหารทุกตัวครับ
x = 3.0 / 3.742 = 0.802
y = 1.0 / 3.742 = 0.267
z = 2.0 / 3.742 = 0.534
ซึ่งใน python เขียนแค่
ก็จะได้คำตอบ
array([ 0.26726124, 0.53452248, 0.80178373])
การหา Norm (ขนาดของ vector) และการทำ vector normalization และอื่นๆ (แบบละเอียด) จากต้นฉบับอ่านได้ที่ http://www.fundza.com/vectors/normalize/index.html เลยครับ
Related Blogs
- Behind the Video: Alicia Keys – 'Un-thinkable (I'm Ready)'
- How important is hair length in a headshot? | Let Tell Me !
- Investment information including spread betting.
- Airsoft BBs .20 gram 4000 round bag SRC Brand | Airsoft Gun Store
- Woods Recruiting › Bay Area local scoreboard for May 9
- WEB TECH GADGET NEWS » Update: Escape – Norm's World XL (Games)
- Kitsap Caucus » Blog Archive » Norm Dicks In Line for Another …
- Opera Finds Flash Unappetizing For Web Video [Blockquote] | Gadget …
- Earthquake Strikes Indonesia's Aceh: Magnitude 7.4 Quake Triggers …
- Household Activities » Blog Archive » Power One Size 312 Zinc Air …
- Hypertension (High Blood Pressure) Diet ? 5 Food Tips That Will …
- Vector One | Gaming: IBM Developing 'City One'
- Delerium – Angelicus (Andy Moor Full Length Mix) | TranceMix
- How to: Increase or normalize volume in Media Player Classic …
- Opera Finds Flash Unappetizing For Web Video [Blockquote …
- What is the difference between HREF and SRC links? « TagFocus.com
- Professional Pre Amp
- » Full Length! Ald. Helen Shiller Mob Chase, Press Conference …
- What is the length of a genital warts outbreak?
- How To Get Over Somebody You Love | My Flirting Secrets
เรื่องที่เกี่ยวข้อง