Law Of Cosines and Vectors

Use this board to discuss 3D programming and math topics that are independent to any particular API.

Law Of Cosines and Vectors

Postby RedKMan on Sat Aug 22, 2009 2:48 am

I'm really struggling to fully understand this,

Use the law of cosines C^2 = a^2 + b^2 = 2ab COS THETA to show that.

Ux Vx + Uy Vy + Uz Vz = ||U|| ||V|| COS THETA

Where a, b and c are the lengths of the sides of a triangle and theta is the angle between sides a and b. Hint, Set C^2 = || U - V ||, a^2 = ||U||^2 and b^2 = ||V||^2. Use the dot product properties.
RedKMan
 
Posts: 20
Joined: Sat Aug 15, 2009 4:58 am

Re: Law Of Cosines and Vectors

Postby Brainstorm on Sat Aug 22, 2009 5:35 pm

So the cosine law is just a geometrical property of any triangle. The triangle has 3 sides of length a, b and c respectively, the angle between the sides a and b is theta. The wiki page for law of cosines has a nice picture - http://en.wikipedia.org/wiki/Law_of_cosines#Vector_formulation
It sort of explains the proof but probably not the best explanation i've seen and it does it in reverse. Let me know if it still doesn't make sense and i'll have a go at prooving it myself.
Brainstorm
 
Posts: 31
Joined: Fri Sep 05, 2008 5:52 pm
Location: Melbourne Australia

Re: Law Of Cosines and Vectors

Postby jase439 on Mon Jan 25, 2010 5:38 pm

I think there's a misprint in the book. The Law of Cosines is:

c^2 = a^2 + b^2 - 2ab cos theta (minus not equal)

Where theta is the angle opposite the hypotenuse. For pythagorean triangles, the cos theta term reduces to 0, hence the all too familiar c^2 = a^2 + b^2.
jase439
 
Posts: 2
Joined: Mon Jan 25, 2010 5:30 pm

Re: Law Of Cosines and Vectors

Postby Hieran_Del8 on Mon Jan 25, 2010 10:00 pm

http://d3dcoder.net/Data/Book2/errata.pdf wrote:In Exercise 7, it should be b ^ 2 =||v|| ^ 2 , not b ^ 2 =||v|| . Also, the law of cosines is:
c^2=a^2+b^2−2abcosθ
Yes, it was a mistake in the dx9 shader book.
Hieran_Del8
 
Posts: 203
Joined: Fri Oct 03, 2008 12:18 pm
Location: Marengo, IL

Re: Law Of Cosines and Vectors

Postby jase439 on Mon Jan 25, 2010 10:38 pm

It is also misprinted in the DX10 book as well (the law of cosines, at least...the first error was corrected).
jase439
 
Posts: 2
Joined: Mon Jan 25, 2010 5:30 pm

Re: Law Of Cosines and Vectors

Postby arje06 on Mon May 24, 2010 6:29 pm

RedKMan wrote:I'm really struggling to fully understand this,

Use the law of cosines C^2 = a^2 + b^2 = 2ab COS THETA to show that.

Ux Vx + Uy Vy + Uz Vz = ||U|| ||V|| COS THETA

Where a, b and c are the lengths of the sides of a triangle and theta is the angle between sides a and b. Hint, Set C^2 = || U - V ||, a^2 = ||U||^2 and b^2 = ||V||^2. Use the dot product properties.


In trigonometry, the law of cosines (also known as the cosine formula or cosine rule) is a statement about a general triangle that relates the lengths of its sides to the cosine of one of its angles. There are a lot of explanations about this, and it was really hard to understand. I suggest this site for you to be able to know more information and have the answers to your questions,
http://www.tutorvista.com/topic/law-of-cosines-vector.

For another information, the Law of Cosines is the relationship between sides and angles in any triangle.
arje06
 
Posts: 1
Joined: Mon May 24, 2010 12:34 am


Return to 3D Theory/Math Board

Who is online

Users browsing this forum: No registered users and 1 guest

cron