# Defining geometry within a cartesian coordinate system

Hello,

Just as a warning before anyone reads my question I am not a mathematician, just an engineer with moderate math skills he wants to expand.

So I'm writing some engineering software which involves defining/interation/modification of geometry within a cartesian system but I currently lack the geometry knowledge to pull it off. I know geometry is a big subject and my research up until now has left overwhelmed so I'm trying to narrow down what I should be learning to get to grips with the ideas I need to do what I want to do.

To give you an idea of what type of things I'm trying to build upto I currently know how to define a straight line using the standard formula (which I store in the software as 2 points but can use the formula to define new points etc.). What I want to be able to do is define curves (curcular, clothoid, parabola etc.) in a way in which an accurate definition can be store within he program of a specific curve. I know some of the standad formulas for curves such as for a parabola on a graph but my curves will be set at specific coordinates at a certain orientation.

I also want to learn how I can solve inerations between geometry such as where a line crosses a curve etc. I've tried to understand calculating whether and where 2 straight lines cross but I haven't found it easy on my own!

I know my math skills are not great and my question is pretty vague but any rough idea of useful topics/skills to learn or any starting points would be appriciated. I will also understand if the answer is "You're jumping into something well over my head". I know the basic geometry you learn at school but that is about it.

Thanks.

It seems that linear algebra is the answer here.

Finding where two lines cross is very easy using linear algebra. You just need to solve a system of two equations. Finding where two arbitrary curves cross is a bit more difficult though, but you can also do it using systems of equations.

Then, it seems that you know how to graph things like ##y=x^2## which is a parabola opening upward. You might want to know a formula for a parabola opening in some diagonal direction. Is that it?

Well, take the parabola ##y=x^2##. Arbitrary points on there are of the form ##(t,t^2)## (thus, any ##t## will give you a point). We can rotate this parabola by multiplying with a rotation matrix. Such a matrix has the form

$$\left(\begin{array}{cc}\cos(\theta) & \sin(\theta)\\ - \sin(\theta) & \cos(\theta)\end{array}\right)$$

The new parabola becomes ##(\cos(\theta)t + \sin(\theta)t^2, -\sin(\theta)t + \cos(\theta)t^2)##. For example, if you want to rotate your parabolia 90 degrees, then ##\theta = \frac{\pi}{2}##. Thus we get ##(t^2,-t)##.

You should probably go through a book on basic applied linear algebra.

I get the geist that for 2 lines it is just a matter of solving the 2 equations but my main problem is (and from my experience the same problem most people have) when I was taugh these things we were taught in such a set way that I didn't fully understand it and don't know how to actually use it to solve things for myself. Such as testing whether 2 lines cross at all? what is the coordinate of the cross over?

I got the feeling someone would use a tranformation matrix. I covered matrices to a very basic level but I can't say I know how to use them for anything! Yes that is an example and to take it another step further how could I define a parabolic curve which passes through 2 specific coordinates? eg. (2,3) and (5,8). I'm guessing I will need to learn certain matrices operations.

I hope that's clear.

I get the geist that for 2 lines it is just a matter of solving the 2 equations but my main problem is (and from my experience the same problem most people have) when I was taugh these things we were taught in such a set way that I didn't fully understand it and don't know how to actually use it to solve things for myself. Such as testing whether 2 lines cross at all? what is the coordinate of the cross over?

Are we talking about lines in a plane? The equations for two lines is given by ##\alpha X + \beta Y = \gamma## and ##aX + bY = c##. The lines cross if and only if

$$\textrm{det}\left(\begin{array}{cc} \alpha & \beta\\ a & b\end{array}\right) \neq 0$$

The coordinate of the cross can be calculated by solving the system

$$\left\{\begin{array}{l} \alpha X + \beta Y = \gamma\\ aX + bY = c\end{array}\right.$$

I got the feeling someone would use a tranformation matrix. I covered matrices to a very basic level but I can't say I know how to use them for anything! Yes that is an example and to take it another step further how could I define a parabolic curve which passes through 2 specific coordinates? eg. (2,3) and (5,8). I'm guessing I will need to learn certain matrices operations.

There are multiple parabolic curves going through those two points. Let's try to find a parabolic curve opening upwards. This has the form ##y = ax^2 + bx + c##. The point ##(2,3)## should be a solution, thus the following should be true ##4a + 2b + c = 3##. Similarly, we want ##25a + 5b + c = 8##. We solve this for ##a## and ##b## by solving the system

$$\left\{\begin{array}{l} 4a + 2b + c = 3\\ 25a + 5b + c = 8\end{array}\right.$$

This system will have multiple solutions. Each of the solutions will give you a parabola opening upward.

I'm starting to get the feeling I'm out of my depth and have alot to learn before I get anywhere. Although I can roughly follow what you are trying to do, most of it makes little sense to me. I keep looking through geometry books and websits but there is just so much information I just don't even know where to start...

What about this example: Say I manage to draw part of a parabolic curve. It's not perpendicular with either axis (lets say it's 23 degress rotated or whatever) and it does not sit on 0,0 but at 12,19. Would a formula for such a curve be difficult to derive?

The new parabola becomes ##(\cos(\theta)t + \sin(\theta)t^2, -\sin(\theta)t + \cos(\theta)t^2)##.

I'm starting to get the feeling I'm out of my depth and have alot to learn before I get anywhere. Although I can roughly follow what you are trying to do, most of it makes little sense to me. I keep looking through geometry books and websits but there is just so much information I just don't even know where to start...

What about this example: Say I manage to draw part of a parabolic curve. It's not perpendicular with either axis (lets say it's 23 degress rotated or whatever) and it does not sit on 0,0 but at 12,19. Would a formula for such a curve be difficult to derive?

I derived the formula above:

The new parabola becomes ##(\cos(\theta)t + \sin(\theta)t^2, -\sin(\theta)t + \cos(\theta)t^2)##.

Just let ##\theta## be 23 degees. Of course, this is a parabola sitting on (0,0). If you want to move the "base pont", then you need to add ##(12,19)##. So the formula is:

$$(12 + \cos(\theta)t + \sin(\theta)t^2,19 -\sin(\theta)t + \cos(\theta)t^2)$$

where ##\theta## is 23 degrees.

You make it seem so easy it's genius! I'm not entirely sure how you managed to derive the formula but that is the type of thing I want to be able to work out.

When it comes to crossing geometry eg. a line crossing the curve. Is it generally the same idea as for the crossing straight lines?

You make it seem so easy it's genius! I'm not entirely sure how you managed to derive the formula but that is the type of thing I want to be able to work out.

When it comes to crossing geometry eg. a line crossing the curve. Is it generally the same idea as for the crossing straight lines?

It's the same idea, except that the system is harder to solve.

I keep reading through what you have put and I think it's starting to click.
How did you come up with the cos, sin etc. matrix?

Is there a name for the this type of mathematics I could use to search for material to learn from?

I keep reading through what you have put and I think it's starting to click.
How did you come up with the cos, sin etc. matrix?

http://en.wikipedia.org/wiki/Rotation_matrix

Is there a name for the this type of mathematics I could use to search for material to learn from?

Search for linear algebra. Or analytic geometry.

Thats great thanks! Now I know what I'm searching for things should be much easier.
You also mentioned plane curve which led me to this:
http://en.wikipedia.org/wiki/Plane_curve

I understand as a function, you put x in and it gives you y but I don't fully understand what the other 2 mean ie. Implicit equation and Parametric equation.

Hopefully I have enough now to get me going.