---
title: Polar coordinates and vectors
heading: Adding arrows tip to tail
eyebrow: A2 · Lesson 26 · Polar coordinates and vectors
xp: 40
---

::: hook
Two wires join at a node, each carrying a 10 A sine-wave current, but one peaks a third of a cycle after the other. How much current leaves on the third wire? Not 20 A. Same-frequency sinusoids add like arrows, each with a length (the amplitude) and an angle (the phase). This lesson is the arithmetic of arrows in a plane: describing them by length and angle or by their two components, and adding them. In A3 the arrows become complex numbers and the method becomes the phasor.

::: play
- The two arrows, $A$ at angle $\alpha$ and $B$ at angle $\beta$, are drawn tip to tail. The third arrow is their sum.
- Set both lengths to 10. Put $\beta$ at 0°, then at 120°, then at 180°. How long is the sum each time?
- Read the sum's components in the strip. How do they relate to the components of $A$ and $B$?
:::
:::

```sim plot
view: complex
range: 15
axes: x, y
slider: A = 0..12 step 0.5 = 10
slider: alpha = -180..180 step 5 = 0 °
slider: B = 0..12 step 0.5 = 10
slider: beta = -180..180 step 5 = 120 °
arrow: A∠alpha | label: A
arrow: B∠beta | from: A∠alpha | color: ch2 | label: B
arrow: A∠alpha + B∠beta | color: ch3 | label: A + B
readout: x part of the sum = Re(A∠alpha + B∠beta) | digits: 4
readout: y part of the sum = Im(A∠alpha + B∠beta) | digits: 4
readout: length of the sum = abs(A∠alpha + B∠beta) | digits: 4
```

::: predict
## Two arrows of length 10 point 120° apart. How long is their sum?

- [ ] 20
- [ ] 0
- [x] 10
- [ ] 17.3

::: reveal
10. Tip to tail, the two arrows and their sum form an equilateral triangle, so the sum is as long as each of them. That's why two of the three wires in a three-phase system, each carrying the same current a third of a cycle apart, combine into a current of the same size: the third wire's.
:::
:::

::: nameit
## Two ways to locate a point

A point in the plane can be given by its **rectangular** coordinates $(x, y)$ or by its **polar** coordinates: its distance $r$ from the origin and its angle $\theta$ from the positive $x$ axis.

$$x = r\cos\theta \qquad y = r\sin\theta$$

$$r = \sqrt{x^2 + y^2} \qquad \theta = \operatorname{atan2}(y, x)$$

Use atan2 (lesson 23) for the angle, not $\tan^{-1}(y/x)$ alone, so that points on the left of the axis get angles between 90° and 270°.

## Vectors

A **vector** is an arrow: a length and a direction, with no fixed starting point. Its **components** are its $x$ and $y$ parts, the rectangular coordinates of its tip when its tail is at the origin.

- **Adding** vectors: place them tip to tail. The sum runs from the first tail to the last tip, and its components are the sums of the components:

$$\vec{A} + \vec{B} = (A_x + B_x,\; A_y + B_y)$$

  Lengths add only when the arrows point the same way. In general $|\vec A + \vec B|$ is anywhere from $\big||\vec A| - |\vec B|\big|$ (opposite directions) to $|\vec A| + |\vec B|$ (same direction).
- **Subtracting** is adding the reversed arrow: $\vec A - \vec B = \vec A + (-\vec B)$.
- **Scaling** by a number stretches the length and keeps the direction (a negative number reverses it).

To add arrows given in polar form: convert each to components, add, convert back.

**The dot product** measures how much two arrows point the same way:

$$\vec A \cdot \vec B = A_xB_x + A_yB_y = |\vec A|\,|\vec B|\cos\theta$$

where $\theta$ is the angle between them. It's zero for arrows at right angles. In physics it's the work done by a force along a displacement; in AC circuits it's the reason only the in-phase part of a current delivers real power.
:::

::: example
## Write the point $(-3, 4)$ in polar coordinates.

::: solution
1. **Length.**
   $$\begin{aligned} r &= \sqrt{9 + 16} \\ &= 5 \end{aligned}$$
2. **Plain inverse tangent.**
   $$\tan^{-1}(4/-3) = -53.13°$$
   but that points down and to the right, and our point is up and to the left.
3. **Fix the quadrant.** atan2 puts it in the right quadrant:
   $$\begin{aligned} \theta &= 180° - 53.13° \\ &= 126.87° \end{aligned}$$

**Answer:** $(-3, 4)$ is $5\angle 126.87°$.
:::
:::

::: example
## Add $10\angle 30°$ and $6\angle 120°$.

::: solution
1. **Components.**
   $$\begin{aligned} 10\angle 30° &= (8.660,\ 5.000) \\ 6\angle 120° &= (-3.000,\ 5.196) \end{aligned}$$
2. **Add.** The sum is
   $$(5.660,\ 10.196)$$
3. **Back to polar.**
   $$\begin{aligned} r &= \sqrt{5.660^2 + 10.196^2} \\ &= 11.66 \\ \theta &= \tan^{-1}(10.196/5.660) \\ &= 60.96° \end{aligned}$$
4. **Check.** The two arrows are 90° apart, so the length should be $\sqrt{10^2 + 6^2} = 11.66$. It is.

**Answer:** the sum is $11.66\angle 60.96°$.
:::
:::

::: example
## Currents of $4\angle 0°$, $3\angle 90°$ and $2\angle 210°$ A flow into a node. What current must flow out on a fourth wire?

::: solution
1. **Add the x components.**
   $$\begin{aligned} x &= 4 + 0 + 2\cos 210° \\ &= 4 - 1.732 \\ &= 2.268 \end{aligned}$$
2. **Add the y components.**
   $$\begin{aligned} y &= 0 + 3 + 2\sin 210° \\ &= 3 - 1 \\ &= 2.000 \end{aligned}$$
3. **Back to polar.** The sum is $(2.268, 2.000)$:
   $$\begin{aligned} r &= \sqrt{2.268^2 + 2^2} \\ &= 3.02\ \text{A} \\ \theta &= \arctan(2/2.268) \\ &= 41.4° \end{aligned}$$
4. **Apply Kirchhoff's current law.** What flows in flows out, so the fourth wire carries $3.02\angle 41.4°$ A away from the node.

**Answer:** $3.02\angle 41.4°$ A must flow out on the fourth wire.
:::
:::

::: check
given: r = 2 | 5 | 10 | 25; t = 20 | 50 | 110 | 200
answer: r*cos(t*pi/180)
tolerance: 0.5%

## What is the $x$ component of an arrow of length {r} at {t}°?

::: right
Right. $x = r\cos\theta$ = {answer}.
:::

::: misses
- [r*sin(t*pi/180)] That's the $y$ component.
- [r*cos(t)] Check your calculator is in degrees, or convert to radians.
- [any] Not yet. $x = r\cos\theta$.
:::
:::

::: check
given: x = 3 | -5 | 8 | -12; y = 4 | 12 | -6 | 9
answer: sqrt(x^2 + y^2)
tolerance: 0.5%

## How far from the origin is the point $(\given{x}, \given{y})$?

::: right
Right. $r = \sqrt{x^2 + y^2}$ = {answer}.
:::

::: misses
- [abs(x) + abs(y)] That's the distance along the grid. Straight-line distance uses Pythagoras.
- [any] Not yet. $r = \sqrt{x^2 + y^2}$.
:::
:::

::: check
given: x = -3 | -8 | -1; y = 4 | 6 | 2
answer: arg(x + j*y)*180/pi
unit: °
tolerance: 0.2%

## At what angle, from the positive $x$ axis, is the point $(\given{x}, \given{y})$?

::: right
Right. It's up and to the left, so the angle is between 90° and 180°: {answer}.
:::

::: misses
- [atan(y/x)*180/pi] That angle points down and to the right. The point is up and to the left: add 180°.
- [atan(y/x)*180/pi + 360] Check which way that points. Up and to the left is between 90° and 180°.
- [any] Not yet. Find $\tan^{-1}(y/x)$, then fix the quadrant.
:::
:::

::: check
given: A = 4 | 6 | 10; B = 3 | 5 | 8; a = 0 | 30; b = 60 | 150 | 170
answer: abs(A*exp(j*a*pi/180) + B*exp(j*b*pi/180))
tolerance: 0.5%

## How long is the sum of $\given{A}\angle\given{a}°$ and $\given{B}\angle\given{b}°$?

::: right
Right. Adding components and taking the length gives {answer}.
:::

::: misses
- [A + B] Lengths only add when the arrows point the same way. Add components.
- [sqrt(A^2 + B^2)] That's only right when they're at 90°. Add the components in general.
- [any] Not yet. Convert both to components, add, then find the length.
:::
:::

::: check
given: ax = 2 | 3 | -4; ay = 5 | 7; bx = 4 | -1 | 6; by = 1 | -6
answer: ax*bx + ay*by
tolerance: 0.01

## What is the dot product of $(\given{ax}, \given{ay})$ and $(\given{bx}, \given{by})$?

::: right
Right. $A_xB_x + A_yB_y$ = {answer}.
:::

::: misses
- [ax*ay + bx*by] Multiply matching components: the two $x$ parts, then the two $y$ parts.
- [ax*by + ay*bx] Pair $x$ with $x$ and $y$ with $y$.
- [any] Not yet. Multiply the $x$ parts, multiply the $y$ parts, and add.
:::
:::

::: check
kind: choice

## Two arrows of length 5 point exactly opposite ways. What is their sum?

- [x] An arrow of length 0
- [ ] An arrow of length 10
- [ ] An arrow of length 5, at right angles to both
- [ ] An arrow of length 7.07

::: right
Right. Tip to tail, the second brings you straight back to where the first started.
:::

::: misses
- [2] That would need them pointing the same way.
- [any] Draw them tip to tail.
:::
:::

::: check
kind: parts
given: m1 = 4 | 6; m2 = 3 | 5; a2 = 90 | 120; m3 = 2 | 3; a3 = 210 | 250

## Currents of $\given{m1}\angle 0°$, $\given{m2}\angle\given{a2}°$ and $\given{m3}\angle\given{a3}°$ A flow into a node. A fourth wire carries the rest away.

::: part
answer: m1 + m2*cos(a2°) + m3*cos(a3°)
unit: A
tolerance: 0.5%

### What is the $x$ component of the total flowing in?

::: misses
- [m1 + m2*sin(a2°) + m3*sin(a3°)] Those are the $y$ components. Use cosines for $x$.
- [any] Add $m\cos\theta$ for each current.
:::
:::

::: part
answer: m2*sin(a2°) + m3*sin(a3°)
unit: A
tolerance: 0.5%

### What is the $y$ component?

::: misses
- [m1 + m2*sin(a2°) + m3*sin(a3°)] The first current lies along the $x$ axis, so it has no $y$ part.
- [any] Add $m\sin\theta$ for each current.
:::
:::

::: part
answer: abs(m1 + m2*exp(j*a2*pi/180) + m3*exp(j*a3*pi/180))
unit: A
tolerance: 0.5%

### How big is the current in the fourth wire?

::: misses
- [m1 + m2 + m3] The currents point in different directions, so they partly cancel.
- [any] The length of the arrow with those components.
:::
:::
:::

::: check
kind: derivation
vars: A = 1..5, B = 1..5, p = -3..3, q = -3..3

## Derive the length of the sum of two arrows, $A\angle p$ and $B\angle q$ (angles in radians).

::: step
answer: A*cos(p) + B*cos(q)

### Write the $x$ component of the sum.
:::

::: step
answer: A*sin(p) + B*sin(q)

### Write the $y$ component.
:::

::: step
answer: A^2 + B^2 + 2*A*B*cos(p - q)
form: simplified

### Square and add the components and simplify, using $\cos p\cos q + \sin p\sin q = \cos(p - q)$. That's the squared length.

::: misses
- [A^2 + B^2] That's the right angle case only. Keep the cross term.
:::
:::

::: right
Right. $|S|^2 = A^2 + B^2 + 2AB\cos(p - q)$, the law of cosines: the sum is longest when the arrows line up and shortest when they point opposite ways.
:::
:::

::: explain
## Why do you add arrows by adding their components, and not by adding their lengths?

::: model
An arrow's components say how far it goes across and how far up. Placing arrows tip to tail adds the across distances together and the up distances together, so the sum's components are the sums of the components. Lengths only add when the arrows point the same way; otherwise some of one arrow's travel cancels or goes sideways to the other's, so the sum is shorter than the two lengths together.
:::
:::

::: practice

::: check
given: r = 3 | 8 | 20; t = 15 | 65 | 140 | 250
answer: r*sin(t*pi/180)
tolerance: 0.5%

## What is the $y$ component of an arrow of length {r} at {t}°?

::: misses
- [r*cos(t*pi/180)] That's the $x$ component.
- [any] $y = r\sin\theta$.
:::
:::

::: check
given: x = -2 | -6 | -9; y = -3 | -5 | -7
answer: arg(x + j*y)*180/pi
unit: °
tolerance: 0.2%

## Between −180° and 180°, what angle is the point $(\given{x}, \given{y})$ at?

::: misses
- [atan(y/x)*180/pi] That points up and to the right. This point is down and to the left: subtract 180°.
- [any] Fix the quadrant after $\tan^{-1}(y/x)$.
:::
:::

::: check
given: A = 5 | 7; B = 5 | 9; a = 0 | 45; b = 100 | 135 | 170
answer: abs(A*exp(j*a*pi/180) + B*exp(j*b*pi/180))
tolerance: 0.5%

## How long is $\given{A}\angle\given{a}° + \given{B}\angle\given{b}°$?

::: misses
- [A + B] Add components, not lengths.
- [any] Components, add, length.
:::
:::

::: check
given: A = 3 | 6; B = 4 | 8; t = 30 | 60 | 120
answer: A*B*cos(t*pi/180)
tolerance: 0.5%

## Two arrows of length {A} and {B} are {t}° apart. What is their dot product?

::: misses
- [A*B*sin(t*pi/180)] Use the cosine of the angle between them.
- [A*B] Only when they point the same way.
- [any] $|\vec A||\vec B|\cos\theta$.
:::
:::

::: check
given: I = 5 | 10 | 16
answer: I
unit: A

## Two currents of {I} A amplitude, a third of a cycle (120°) apart, meet at a node. What is the amplitude of their sum?

::: misses
- [2*I] They aren't in step. Add them as arrows 120° apart.
- [0] They'd cancel only if they were half a cycle apart.
- [any] Two equal arrows 120° apart make an equilateral triangle.
:::
:::
:::
