My Digital Garden

Cartesian coordinates


Cartesian plane denoted R2\R^2

Axes and Quadrants

xaxis={(x,y)R2:y=0}yaxis={(x,y)R2:x=0}first quadrant={(x,y)R2:x>0,y>0}second quadrant={(x,y)R2:x<0,y>0}third quadrant={(x,y)R2:x<0,y<0}fourth quadrant={(x,y)R2:x>0,y<0}\begin{alignedat}{1} x-axis &= \lbrace (x,y) \in \R^2 : y=0 \rbrace \\ y-axis &= \lbrace (x,y) \in \R^2 : x=0 \rbrace \\ first \nobreakspace quadrant &= \lbrace (x,y) \in \R^2 : x>0, y>0 \rbrace \\ second \nobreakspace quadrant &= \lbrace (x,y) \in \R^2 : x<0, y>0 \rbrace \\ third \nobreakspace quadrant &= \lbrace (x,y) \in \R^2 : x<0, y<0 \rbrace \\ fourth \nobreakspace quadrant &= \lbrace (x,y) \in \R^2 : x>0, y<0 \rbrace \\ \end{alignedat}

Calculating distance

pythagoras drawio

z=x2+y2z = \sqrt{x^2 + y^2}

Distance formula

Given three points:

A=(xa,ya)B=(xb,yb)C=(xc,yc)dist(A,B)=(xaxb)2+(yayb)2dist(A,C)=(xaxc)2+(yayc)2\begin{alignedat}{1} A &= (x_a, y_a) \\ B &= (x_b, y_b) \\ C &= (x_c, y_c) \\ \\ dist(A,B) &= \sqrt{(x_a-x_b)^2+(y_a-y_b)^2} \\ \\ dist(A,C) &= \sqrt{(x_a-x_c)^2+(y_a-y_c)^2} \end{alignedat}


If AA and BB are in Cluster II
and CC is in Cluster IIII


dist(A,B)<<dist(A,C)dist(A,B)<< dist(A,C)


Slope of line segment

A=(a,b)A = (a,b)
B=(c,d)B = (c,d)

SlopeofAB=m=dbca\begin{alignedat}{1} Slope\enspace of \enspace \overrightarrow{AB} &= \\ m &= \frac{d-b}{c-a} \end{alignedat}

Basic line formula

yy0=m(xx0)y-y_0 = m(x-x_0) "Point-slope" form
y=mx+by = mx + b "slope-intercept" form

Given a line that passes through (2,1)(2,1) and (3,2)(3,2), i.e. a slope of 1,
for any point (x,y)(x,y) to be on the line, the slope from (2,1)(2,1) to (x,y)(x,y) must be 11

1=y1x2\begin{alignedat}{1} 1 &= \frac {y-1}{x-2} \\ \end{alignedat}


y1=1(x2)\begin{alignedat}{1} y − 1 &= 1(x − 2) \end{alignedat}

so a definition of the line is:

={(x,y)R2:y1=1(x2)}\begin{alignedat}{1} \ell = \big\lbrace (x,y) \in \R^2 : y − 1 &= 1(x − 2) \big\rbrace \\ \end{alignedat}

Point-slope formula for line

Above generalises to

If a line \ell has slope mm, and if (x0,y0)(x_0, y_0) is any point on \ell, then \ell has the equation:

yy0=m(xx0)\begin{alignedat}{1} y-y_0 = m(x-x_0) \end{alignedat}

Slope-intercept formula for line

Considering same line defined as

={(x,y)R2:y1=1(x2)}\begin{alignedat}{1} \ell = \big\lbrace (x,y) \in \R^2 : y − 1 &= 1(x − 2) \big\rbrace \\ \end{alignedat}

This line intercepts the yy-axis at a point (0,b)(0,b) i.e.

b1=1(02)b=1\begin{alignedat}{1} b-1 &= 1(0-2) \\ b &= -1 \end{alignedat}

Substituting this intercept point back into the Point-Intercept formula:

y(1)=1(x0)y+1=xy=1x1\begin{alignedat}{1} y-(-1) &= 1(x-0) \\ y+1 &= x \\ y &= 1x-1 \end{alignedat}

This generalises into the Slope-Intercept formula for the line:

If \ell has slope mm, and \ell hits the y-axis at (0,b)(0, b), then

y=mx+b\begin{alignedat}{1} y &= mx + b \\ \end{alignedat}

is an equation for \ell, where mm is the slope and bb is the y-intercept.

Based on course material by Paul Bendich and Daniel Egger from Data Science Maths Skills

Referred in


Unless otherwise noted all content on this site is (c) copyright Julian Elve 2020 onwards, released under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International licence.

Cartesian coordinates