How do I convert coordinates from bottom left as 0,0 to middle as 0,0

3.3k Views Asked by At

I have two coordinate systems. I made a picture of each. I would like to convert from the first to the second.

The first coordinate system

The second coordinate system

In the first coordinate system I have 0,0 as the top left corner and x and y go positive to the right and down.

In the second coordinate system I have 0,0 as the middle and x and y go positive up and to the right.

I know this is a basic math question, but I am having a hard time wrapping my head around this.

2

There are 2 best solutions below

0
On BEST ANSWER

Let $(x,y)$ be a point in the first coordinate system and let $f$ be the function that maps a point in the first coordinate system to one in the second. Then I believe,

$$f((x,y)) = (x-12, -(y-6)),$$

is the mapping you're looking for.

Notice that

  • $f((0,0)) = (-12, 6)$
  • $f((12, 6)) = (0,0)$
  • $f((24, 12)) = (12, -6)$

which are consistent with the images you've linked.

0
On

What you have in your second example is a canonical basis, that is: Generated by the vectors $\{(1,0),(0,1)\}_A$. Now you want to convert this basis to your first example, let's see: Going down is positive, this means that $(1,0)\mapsto (-1,0)$ and going to the right is positive, then: $(0,1)\mapsto (0,1)$, the new basis would be: $\{(-1,0),(0,1)\}_B$.

Now you can use the formulas for change of basis ($e_1,e_2$ are the vectors in the basis):

$$\langle X,e_1 \rangle=x \\ \langle X, e_2 \rangle=y$$

$\langle (q ,w),(e,r) \rangle=qe+wr $ is the dot product of two vectors.

Whenever you express coordinates, you express them in a basis, you just need to switch it. Let's say you have a vector $X=(x,y)$ in basis $A$, this means that:

$$\langle (x,y),(1,0) \rangle=x*1+y*0=x \\ \langle (x,y),(0,1) \rangle=x*0+y*1=y$$

Now changing the vectors in the base:

$$\langle (x,y),\overbrace{(-1,0)}^{change} \rangle=x*-1+y*0=-x \\ \langle (x,y),\underbrace{(0,1)}_{\text{change}} \rangle=x*0+y*1=y$$

That is: If I put a vector from the first basis into the second, say $(-4,4)$:

$$\langle (-4,4),(-1,0) \rangle=-(-4) =4\\ \langle (-4,4),(0,1) \rangle=4$$

Note that this works only for orthogonal axis'. I'm not sure if this is what you want, but even if it isn't, I guess it could help you - It's not clear what you made in your drawings, but it seems that you tried to express a contraction (a vector in one basis will appear smaller in the other, to do that you just need to scalar-multiply the vectors in the other basis by any ratio that pleases you). You can see that:

$$\langle (q,w),\alpha (e,r) \rangle = \alpha \langle (q,w), (e,r) \rangle = \alpha q e + \alpha w r = \alpha (qe+wr)$$

So if you choose an $\alpha <1$, you'll shrink the vectors in the basis. If an $\alpha >1$, you'll enlarge them. If we need lectures on change of basis, you can watch Wildberger Lectures on Linear Algebra. The first few videos might suffice.