Neuron 101

Math foundations / Dot product

Türkçe

Plate3

Unit 1 · Topic 3 of 11

Dot product

Medium, 7 min, 6 steps

a
Keyboard: left and right arrows change the step, space plays and pauses.

Step 1 of 6 a

The first vector a

a = (4, 1.50), with length 4.27.

Open in Colab
  1. import math
  2. a = [4.0, 1.5]
  3. aci = math.radians(50.0)
  4. yon = math.atan2(a[1], a[0]) + aci
  5. bx = 3.0 * math.cos(yon)
  6. by = 3.0 * math.sin(yon)
  7. carpim = a[0] * bx + a[1] * by
  8. a_boy = math.hypot(a[0], a[1])
  9. golge = carpim / a_boy
  10. print(carpim, golge)
aci
50
boy
3
ab
8.24
golge
1.93