Skip to content
Search

Polar coordinate system

lastmod 2024-03-11created 2024-03-054 edits

The polar coordinate system is a two-dimensional coordinate system that represents a position on a plane using an angle and a distance. The polar coordinate system is most useful when the relationship between two points is easily expressed in terms of angles and distances. Relationships that appear complicated with trigonometric functions in the Cartesian coordinate system are often expressed simply in the polar coordinate system. Because it is a two-dimensional coordinate system, polar coordinates are determined by two components, a radial component and an angular component. The radial component, usually denoted \(r\), represents the distance from the pole (the origin in Cartesian coordinates). The angular component, usually denoted \(\theta\), represents the size of the angle measured counterclockwise from 0° (corresponding to the positive direction of the x-axis in the Cartesian coordinate system).

How does it work?

As you know, a line in the image space can be expressed with two variables. For example:

Hough_Lines_Tutorial_Theory_0.jpg

\(y = (−cosθ * sinθ)x + (r sinθ)\)

Conversion between Korean: 극좌표 and Korean: 데카르트 좌표

r and θ can be converted to the Cartesian coordinates x and y using trigonometric functions:

\(\begin{align} x &= r \cos \theta \\ y &= r \sin \theta \end{align}\)

The Cartesian coordinates x and y can be converted to the polar coordinate r:

\(r^{2} = x^{2} + y^{2} (using the Pythagorean theorem)\)

Python code to find the coordinate (x2,y2) reached by moving a distance x from the center point (cx,cy) at an arbitrary angle (a)

import math

def polar_to_cartesian(cx, cy, x, a):
    x2 = cx + x * math.cos(math.radians(a))
    y2 = cy + x * math.sin(math.radians(a))
    return x2, y2

See also

Favorite site

author Zer0 sitemap