Radians and Coordinate Systems

Definition of an angle

In primary or middle school, we learned the static definition of an angle: a figure formed by two rays with a common endpoint is called an angle.

However, this definition limits angles to [0,360∘][0, 360^\circ], which creates difficulties for deeper study and cannot explain some questions clearly, such as: what does a rotation of 720∘720^\circ mean?

High-school mathematics introduces the dynamic definition of an angle: a figure formed when a ray in a plane rotates around its endpoint from one position to another is called an angle.

The starting position is called the initial side, and the ending position is called the terminal side. We define:

  • An angle formed by rotation in the counterclockwise direction is a positive angle, and its measure is positive;
  • An angle formed by rotation in the clockwise direction is a negative angle, and its measure is negative;
  • An angle whose terminal side has not rotated relative to its initial side is a zero angle, and its measure is 0∘0^\circ.

This extends the concept of an angle to an arbitrary angle.

Note

The initial and terminal sides of a zero angle coincide, but not every angle whose initial and terminal sides coincide is a zero angle, such as an angle that is a multiple of 360∘360^\circ.

Radian measure

In practical applications, angles are often converted to various parameters, and describing angles using radians reduces the use of coefficients. We therefore introduce radian measure:

A central angle subtending an arc whose length equals the radius is called a 11-radian angle. It is denoted by rad\text{rad} and read as radian.

According to the definitions above, positive angles have positive radian measures, negative angles have negative radian measures, and the zero angle has radian measure 00. If a circle of radius rr has a central angle α\alpha subtending an arc of length ll, then:

∣α∣=lr|\alpha|=\dfrac{l}{r}

This formula can also be used to derive the formulas for arc length and sector area, which we omit here.

Thus, a 360∘360^\circ angle has radian measure 2π2\pi. With this correspondence, degree values and radian measures can be converted:

krad⁡=π180∘n∘k \operatorname{rad} = \frac{\pi}{180^\circ} n^\circ

Consider an angle. If its terminal side is rotated one full turn, or even multiple turns, while the initial side remains fixed, the terminal side always ends at the same position. Such angles are called coterminal angles.

The set of angles coterminal with angle α\alpha is easy to obtain: {φ∣φ=α+2kπ,k∈Z}\{\varphi \mid \varphi = \alpha + 2k\pi, k \in \mathbf{Z}\}.

This can be understood as continuously adding full turns to the side of the angle without changing the terminal-side position.

The mathematical constants π\pi and τ\tau

Some views in the Western mathematical community hold that the “true circle constant” should be 2π2\pi, denoted by the Greek letter τ\tau. Supporters of the new circle constant celebrate the “true” Pi Day on June 28.

For example, in radian measure, a full angle is 2π2\pi, and directly dividing 2π2\pi gives equal divisions of a full angle. Also, combinations of 2π2\pi occur frequently in complex analysis, and so on.

To follow customary conventions in different regions of China, OI Wiki uses the parameter π\pi to denote the circle constant.

Conventional notation for π\pi in programming

In C/C++, π\pi is generally taken to be acos(-1), since this value is the floating-point number closest to π\pi. Writing π\pi using acos(-1) or 4 * atan(1) gives 3.141592653589793100003.14159265358979310000.

Using other values, such as acos(-1.0/2.0), acos(1.0/2.0), or asin(1.0/2.0), gives 3.141592653589793600003.14159265358979360000, which is not the closest floating-point number to π\pi.

If you can remember it, you can also write 3.14159265358979323.1415926535897932 directly.

Cartesian coordinate system

Two mutually perpendicular number axes with a common origin in the same plane form a Cartesian coordinate system (Rectangular Coordinates).

Usually, the two number axes are placed horizontally and vertically, with rightward and upward directions as their positive directions. The horizontal axis is called the xx-axis (x-axis) or horizontal axis, and the vertical axis is called the yy-axis (y-axis) or vertical axis. The xx-axis and yy-axis together are called the coordinate axes. Their common origin OO is called the origin of the Cartesian coordinate system (origin). A Cartesian coordinate system with OO as its origin is denoted by xOyxOy.

The xx-axis and yy-axis divide the coordinate plane into four quadrants (quadrant). The upper-right part is the first quadrant; the other three parts, in counterclockwise order, are the second, third, and fourth quadrants. The axes form the boundaries of the quadrants, so points on either axis and the origin are not in any quadrant. Usually, the xx- and yy-axes use the same unit length, but different unit lengths may be used in special cases.

Describing positions in a Cartesian coordinate system

In a Cartesian coordinate system, every point in the plane corresponds to a unique ordered pair (that is, the point's coordinates (coordinates)); conversely, every ordered pair corresponds to a unique point in the plane.

For any point CC in the plane, draw perpendiculars through CC to the xx- and yy-axes. The corresponding feet on the xx- and yy-axes, denoted by a,ba, b, are respectively called the abscissa and ordinate of CC. The ordered pair (ordered pair) (a,b)(a, b) is called the Cartesian coordinate of CC. A point has different coordinates in different quadrants or on different axes.

Polar coordinate system

Consider a practical situation such as navigation: one would say “point BB is 30∘30^\circ north of east from point AA, at a distance of 100100 meters”, rather than “construct a Cartesian coordinate system with AA as the origin, giving B(50,503)B(50,50\sqrt 3)”.

Thus:

  1. Choose a fixed point OO in the plane, called the pole;
  2. Draw a ray OxOx from the pole, called the polar axis;
  3. Choose a unit length (usually 11 in mathematical problems), an angular unit (usually radians), and its positive direction (usually counterclockwise);

This establishes a polar coordinate system.

Describing positions in a polar coordinate system

Let AA be a point in the plane.

  • The distance ∣OA∣|OA| between the pole OO and AA is called the radius vector, denoted by ρ\rho;
  • The angle ∠xOA\angle xOA whose initial side is the polar axis and terminal side is OAOA is called the polar angle, denoted by φ\varphi;

Then the ordered pair (ρ,φ)(\rho,\varphi) is the polar coordinate of AA.

By the definition of coterminal angles, (ρ,φ)(\rho,\varphi) and (ρ,φ+2kπ) (k∈Z)(\rho,\varphi + 2k\pi)\ (k\in \mathbf{Z}) represent the same point. In particular, the pole has polar coordinates (0,φ) (φ∈R)(0,\varphi)\ (\varphi \in \mathbf{R}), so points in the plane have infinitely many polar-coordinate representations.

If we require ρ≥0,0≤φ<2π\rho \ge 0,0 \le \varphi < 2\pi, every point in the plane other than the pole can be represented by a unique ordered pair (ρ,φ)(\rho,\varphi), and the point represented by (ρ,φ)(\rho,\varphi) is uniquely determined.

Conversion between Cartesian and polar coordinate systems

Sometimes it is inconvenient to study a figure in polar coordinates. To study it in Cartesian coordinates, use the conversion formulas. The Cartesian coordinates (x,y)(x,y) of point A(ρ,φ)A(\rho,\varphi) are:

x=ρcos⁡φy=ρsin⁡φ\begin{aligned} x &= \rho \cos \varphi \\ y &= \rho \sin \varphi \end{aligned}

Consequently:

ρ2=x2+y2tan⁡φ=yx    (x≠0)\begin{aligned} \rho^2 &= x^2 + y^2\\ \tan \varphi &= \frac{y}{x}\ \ \ \ (x\not =0) \end{aligned}

Thus ρ=x2+y2\rho = \sqrt{x^2+y^2}.

However, tan⁡φ\tan\varphi values with the same yx\dfrac{y}{x} may correspond to two possible values of φ\varphi, so the direction must also be determined from the values of x,yx, y. Specifically, define:

atan2⁡(y,x)={arctan⁡(yx)if x>0arctan⁡(yx)+πif y≥0,x<0arctan⁡(yx)−πif y<0,x<0π/2if y>0,x=0−π/2if y<0,x=0anyif y=0,x=0\operatorname{atan2}(y, x) = \begin{cases} \arctan(\frac{y}{x}) & \text{if } x > 0 \\ \arctan(\frac{y}{x}) + \pi & \text{if } y \ge 0, x < 0 \\ \arctan(\frac{y}{x}) - \pi & \text{if } y < 0, x < 0 \\ \pi/2 & \text{if } y > 0, x = 0 \\ -\pi/2 & \text{if } y < 0, x = 0 \\ \text{any} & \text{if } y = 0, x = 0 \end{cases}

Then φ=atan2⁡(y,x)\varphi = \operatorname{atan2}(y, x). Note that the range of this function is (−π,π](-\pi, \pi].

The function is defined in the <math.h> or <cmath> library in C/C++; call it with atan2(y, x).

Cartesian coordinate system in space

Establish a Cartesian coordinate system in space as follows:

  1. Choose a point OO in space;
  2. Through OO, draw three mutually perpendicular number axes Ox→,Oy→,Oz→\overrightarrow{Ox}, \overrightarrow{Oy}, \overrightarrow{Oz}, called the xx-axis (horizontal axis), yy-axis (vertical axis), and zz-axis (upward axis), collectively called the coordinate axes. Their positive directions follow the right-hand rule: hold the zz-axis with the right hand; when the four fingers turn from the positive direction of the xx-axis toward the positive direction of the yy-axis, the thumb points in the positive direction of the zz-axis;
  3. Set the length unit on each axis, usually to 11.

This forms the spatial Cartesian coordinate system O−xyzO-xyz. The fixed point OO is the origin of this coordinate system.

Any two coordinate axes determine a plane, giving three mutually perpendicular planes, collectively called coordinate planes. The coordinate plane determined by the xx- and yy-axes is the xOyxOy plane; similarly, there are the yOzyOz and zOxzOx planes. The three coordinate planes divide space into eight parts, each called an octant.

Describing positions in a spatial Cartesian coordinate system

After fixing the spatial Cartesian coordinate system O−xyzO-xyz, a one-to-one correspondence can be established between points in space and triples.

Let MM be a point in space. Through MM, draw planes perpendicular to the xx-, yy-, and zz-axes. Let their intersections with the xx-, yy-, and zz-axes be P,Q,RP, Q, R, respectively. The points P,Q,RP, Q, R are called the projections of MM onto the xx-, yy-, and zz-axes. If the coordinates of P,Q,RP, Q, R on the xx-, yy-, and zz-axes are x,y,zx, y, z, respectively, then MM determines a triple (x,y,z)(x, y, z).

Conversely, given a triple (x,y,z)(x, y, z), take on the xx-axis the point PP with coordinate xx, on the yy-axis the point QQ with coordinate yy, and on the zz-axis the point RR with coordinate zz. Through P,Q,RP, Q, R, draw planes perpendicular to the xx-, yy-, and zz-axes, respectively. They intersect at a point MM in space, and MM is the point determined by the triple (x,y,z)(x, y, z).

Thus, a one-to-one correspondence is established between a spatial point MM and a triple (x,y,z)(x, y, z). The triple (x,y,z)(x, y, z) is called the coordinate of MM, written as M(x,y,z)M(x, y, z); xx is the abscissa, yy the ordinate, and zz the applicate.

Cylindrical coordinate system

A spatial cylindrical coordinate system extends polar coordinates to three dimensions: start with the polar coordinate system used in the plane, then add a zz-axis perpendicular to the plane through the pole OO, pointing upward.

To find the point described by cylindrical coordinates (ρ,φ,z)(\rho, \varphi, z), first handle ρ\rho and φ\varphi in the polar coordinate system, then move “up” or “down” along the zz-axis according to the zz coordinate.

Conversion between cylindrical and spatial Cartesian coordinate systems

The values of zz are the same in both coordinate systems.

For the conversion between (x,y)(x,y) and (ρ,φ)(\rho, \varphi), see Conversion between Cartesian and polar coordinate systems.

Spherical coordinate system

Spherical coordinates can be determined as follows:

  1. Stand at the origin facing the direction of the horizontal polar axis; the vertical axis points from the feet toward the head;
  2. Raise the arm toward the vertical polar-axis direction;
  3. Rotate counterclockwise by angle φ\varphi;
  4. Rotate the arm downward by angle ϑ\vartheta; the arm points in the direction specified by φ\varphi and ϑ\vartheta;
  5. Move a distance rr from the origin along that direction.

This reaches the point described by spherical coordinates (r,ϑ,φ)(r,\vartheta,\varphi). Here ϑ\vartheta is called the zenith angle, and φ\varphi the azimuth angle.

Warning

For various reasons, some sources use ϕ\phi for the zenith angle and θ\theta for the azimuth angle. Be sure to pay attention to this when reading an article about spherical coordinates.

When writing about spherical coordinates, it is recommended to state in advance which symbols represent the zenith and azimuth angles.

Conversion between cylindrical and spherical coordinate systems

The values of φ\varphi are the same in both coordinate systems.

From cylindrical coordinates to spherical coordinates:

r=ρ2+z2ϑ={arctan⁡(ρz)if z>0π/2if z=0,ρ≠0arctan⁡(ρz)+πif z<0\begin{aligned} r &= \sqrt{\rho^2 + z^2} \\ \vartheta &= \begin{cases} \arctan\left(\frac{\rho}{z}\right) & \text{if }z > 0 \\ \pi/2 & \text{if }z = 0, \rho \not= 0 \\ \arctan\left(\frac{\rho}{z}\right) + \pi & \text{if }z < 0 \\ \end{cases} \end{aligned}

For the point (0,0,0)(0,0,0) in cylindrical coordinates, its spherical ϑ\vartheta is undefined.

From spherical coordinates to cylindrical coordinates:

ρ=rsin⁡ϑz=rcos⁡ϑ\begin{aligned} \rho &= r \sin \vartheta \\ z &= r \cos \vartheta \end{aligned}

Conversion between spatial Cartesian and spherical coordinate systems

This can be used together with Conversion between Cartesian and polar coordinate systems and Conversion between cylindrical and spherical coordinate systems, or the formulas below can be used directly:

From spatial Cartesian coordinates to spherical coordinates:

r=x2+y2+z2ϑ=arccos⁡(zx2+y2+z2)φ=atan2⁡(y,x)\begin{aligned} r &= \sqrt{x^2 + y^2 + z^2} \\ \vartheta &= \arccos\left(\frac{z}{\sqrt{x^2 + y^2 + z^2}}\right) \\ \varphi &= \operatorname{atan2}(y, x) \end{aligned}

The definition of atan2⁡\operatorname{atan2} is given in Conversion between Cartesian and polar coordinate systems.

For the point (0,0,0)(0,0,0) in the spatial Cartesian coordinate system, the values of its spherical ϑ\vartheta and φ\varphi are undefined.

From spherical coordinates to spatial Cartesian coordinates:

x=rsin⁡ϑcos⁡φy=rsin⁡ϑsin⁡φz=rcos⁡ϑ\begin{aligned} x &= r \sin \vartheta \cos \varphi \\ y &= r \sin \vartheta \sin \varphi \\ z &= r \cos \vartheta \end{aligned}

This content comes from OI Wiki: Radians and Coordinate Systems. See the original for authors and revision history. AIOJ has adapted the formatting, in-site links, and resource paths.

Content is shared under CC BY-SA 4.0 and SATA license; additional terms are governed by the original notice. Thanks to the OI Wiki authors and contributors; per the SATA terms, please visit the OI Wiki repository and star it to show your support.