Question: I have two points `A (x1,y1)` and `B (x2,y2)` that are given as an input to the program. I have to find a third point `C` that lies on the line `AB` and is at a distance `10` away from the point A.

I can easily get the slope of the line but that doesn't give me the full equation for the line. Even if I get the full equation, I am not sure using this equation, how would I find out a point that is `x` distance away from A.

Any suggestions on how to approach this?

Answer: 
You can use the sine or the cosine (times 10) of the angle of the line to get the horizontal or vertical distance of the point that is a distance of 10 from a given point. A shortcut is to use the horizontal or vertical distance divided by the direct distance between the points to get the sine or cosine.
![enter image description here](https://i.stack.imgur.com/tT4DY.jpg)

You can see from the image that your given points are x1,y1 and x2,y2. You need to find an intermediate point at a distance 'R' from point x1,y1. 

All you need to do is to find θ using

`Tan θ = (y2-y1)/(x2-x1)`

Then you can get the intermediate point as (R \* cos θ),(R \* Sin θ)

I have drawn this assuming positive slope.

Going on similar lines you can seek a solution for other special cases lile:

i. Horizontal line
ii. Vertical line
iii. Negative slope

Hope it clarifies.