This isn't so much a programming problem (well most I see aren't), but it's a problem I'm trying to work out for a program and I'm not sure of it (probably just don't remember fully how to do it in a true logical way.
The problem (draw it out to imagine if you must): Say I have two points on a cartesian coordinate system. Having this information gives us some relative distances, which allows us to form a right triangle. I can take the x and y values and apply the Pythagorean Theorem to get the distance between the two points. All is fine here.
Now I want to draw a point that is between the two original points, where the distance on the x-axis is 1/2 the original distance of the points (basically in the middle), and the y distance is on the hypotenuse of the triangle described in the previous paragraph.
Basically:
Let a be the horizontal x-axis distance between the two points.
Let b be the vertical y-axis distance between the original two points.
let c be the hypotenuse or the actual distance between the two original points.
My initial assumption was that the x-distance for the old point and the new point in between is 0.5a. Therefore, since a new right triangle is formed within the bigger right triangle, the other distances of it would be 0.5b and 0.5c, but I wasn't sure since I'm not sure there's a provable arithmetic relationship as described.
Am I on the right track or is there something I'm missing to solve this problem?
The problem (draw it out to imagine if you must): Say I have two points on a cartesian coordinate system. Having this information gives us some relative distances, which allows us to form a right triangle. I can take the x and y values and apply the Pythagorean Theorem to get the distance between the two points. All is fine here.
Now I want to draw a point that is between the two original points, where the distance on the x-axis is 1/2 the original distance of the points (basically in the middle), and the y distance is on the hypotenuse of the triangle described in the previous paragraph.
Basically:
Let a be the horizontal x-axis distance between the two points.
Let b be the vertical y-axis distance between the original two points.
let c be the hypotenuse or the actual distance between the two original points.
My initial assumption was that the x-distance for the old point and the new point in between is 0.5a. Therefore, since a new right triangle is formed within the bigger right triangle, the other distances of it would be 0.5b and 0.5c, but I wasn't sure since I'm not sure there's a provable arithmetic relationship as described.
Am I on the right track or is there something I'm missing to solve this problem?