Skip to main content
Grammar
Link
DMGregory
  • 136.3k
  • 22
  • 247
  • 373

Why don't Javascriptdoesn't JavaScript's Math.cos doesn'tfunction match this vector tutorial?

added 18 characters in body
Source Link
doppelgreener
  • 7.3k
  • 7
  • 43
  • 69

I'm following

   http://www.mathguide.com/lessons2/Vectors.html#combiningthis MATHguide lesson on combining vectors and have reached this part:

 Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130o> = <30cos130o, 30sin130o> = <-19.3, 23.0>.
n = <40, 65o> = <40cos65o, 40sin65o> = <16.9, 36.3>. 

Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130°> = <30 cos 130°, 30 sin 130°> = <-19.3, 23.0>. n = <40, 65°> = <40 cos 65°, 40 sin 65°> = <16.9, 36.3>.

(The lower case o is rendered as a degree symbol) To To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Where did I go wrong?

I'm following

 http://www.mathguide.com/lessons2/Vectors.html#combining

 Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130o> = <30cos130o, 30sin130o> = <-19.3, 23.0>.
n = <40, 65o> = <40cos65o, 40sin65o> = <16.9, 36.3>. 

(The lower case o is rendered as a degree symbol) To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Where did I go wrong?

I'm following  this MATHguide lesson on combining vectors and have reached this part:

Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130°> = <30 cos 130°, 30 sin 130°> = <-19.3, 23.0>. n = <40, 65°> = <40 cos 65°, 40 sin 65°> = <16.9, 36.3>.

To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Where did I go wrong?

deleted 12 characters in body; edited tags; edited title
Source Link
user1430
user1430

Why don't Javascript Math.cos doesn't match this vector tutorial?

I'm following

http://www.mathguide.com/lessons2/Vectors.html#combining

 Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130o> = <30cos130o, 30sin130o> = <-19.3, 23.0>.
n = <40, 65o> = <40cos65o, 40sin65o> = <16.9, 36.3>. 

(The lower case o is rendered as a degree symbol) To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Running

Where did I go wrong?

Javascript Math.cos doesn't match this vector tutorial

I'm following

http://www.mathguide.com/lessons2/Vectors.html#combining

 Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130o> = <30cos130o, 30sin130o> = <-19.3, 23.0>.
n = <40, 65o> = <40cos65o, 40sin65o> = <16.9, 36.3>. 

(The lower case o is rendered as a degree symbol) To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Running

Where did I go wrong?

Why don't Javascript Math.cos doesn't match this vector tutorial?

I'm following

http://www.mathguide.com/lessons2/Vectors.html#combining

 Next, we need to convert their forces to horizontal and vertical components. Let's use k for Kim's vector and n for Noah's vector.

k = <30, 130o> = <30cos130o, 30sin130o> = <-19.3, 23.0>.
n = <40, 65o> = <40cos65o, 40sin65o> = <16.9, 36.3>. 

(The lower case o is rendered as a degree symbol) To get the X part of Kim's vector, I run 30 * Math.cos(130), I get -11.018739913640896, which is not -19.3. To get the Y part of Kim's vector, I run 30 * Math.sin(130) which is -27.903178505602853, which is not the 23.0 listed by the example.

Where did I go wrong?

Source Link
Loading