MHB Formula to extend a line in 3d (opposite of midpoint formula)

  • Thread starter Thread starter LMHmedchem
  • Start date Start date
  • Tags Tags
    3d Formula Line
AI Thread Summary
To extend a line in 3D from point 1 to point 2, a vector along the line can be defined using the formula that incorporates a parameter t. This allows for the generation of additional points by adjusting t, where the new coordinates are calculated as x3 = x1 + (x2 - x1) * t, y3 = y1 + (y2 - y1) * t, and z3 = z1 + (z2 - z1) * t. In Excel, this can be implemented with a formula that uses a multiplier in a designated cell to determine the extension distance. A multiplier less than 1.0 places the new point between the two original points, while a value greater than 1.0 extends beyond point 2. This method effectively provides a straightforward solution for extending lines in 3D space.
LMHmedchem
Messages
20
Reaction score
0
Hello,

I have some simple 3d data like,

Code:
point 1: x1 = 5.8573375, y1 = -4.17885, z1 = 2.338175
point 2: x2 = -3.26132, y2 = 1.28276, z2 = 0.931583

I need to be able to extend the line from point 1 through point 2 to some additional distance.

There are a few posts on stackexchange, but they are all in c++ code and I couldn't get results in excel that look correct. Maybe it's just too late in the day. What I found was more or less,

Code:
x3 = x2 * M - x1, y3 = y2 * M - y1, z3 = z2 * M - z1 where M is a multiplier

For the example I gave above, this gives me a point that is no where near anything that resembles an extension of the line from point 1 to point 2.

Code:
x3 = 2.92866875, y3 = 4.82023, z3 = -1.8723835

Maybe I just got the parenthesis wrong or something lame like that. This seems like it should be very simple but I'm not sure if I need to find the slope first or if something like the above will work.

Can someone point me to the correct formula?

Thanks,

LMHmedchem
 
Mathematics news on Phys.org
If you have a line in 3 dimensions specified by the two points:

$$\left(x_1,y_1,z_1\right),\,\left(x_2,y_2,z_2\right)$$

Then a vector along the line can be given by:

$$\vec{v}=\left[\begin{array}{c}x_1+\left(x_2-x_1\right)t \\ y_1+\left(y_2-y_1\right)t \\ z_1+\left(z_2-z_1\right)t \end{array}\right]$$

You can then use the parameter $t$ to generate additional points on the line. :)
 
Thanks, that worked easily.

In excel, this looks like,

for the new x coordinate (x3)
Code:
=A2+(A4-A2)*$D$2

where,
A2 is the cell containing x1
A4 is the cell containing x2
$D$2 is cell containing the multiplier

If the multiplier is < 1.0, the new point will fall between point 1 and point 2. A multiplier value of 0.5 would give you the same result as using the midpoint formula. The multiplier must be > 1.0 for point 3 to be beyond point 2. I would guess that if the multiplier is negative, point 3 would occur on the line from point 1 to point 2 but before point 1 but I haven't confirmed that.

I have a similar question but I will put that in a new thread because it is likely a more complex solution.

Thanks again,

LMHmedchem
 
Seemingly by some mathematical coincidence, a hexagon of sides 2,2,7,7, 11, and 11 can be inscribed in a circle of radius 7. The other day I saw a math problem on line, which they said came from a Polish Olympiad, where you compute the length x of the 3rd side which is the same as the radius, so that the sides of length 2,x, and 11 are inscribed on the arc of a semi-circle. The law of cosines applied twice gives the answer for x of exactly 7, but the arithmetic is so complex that the...
Thread 'Video on imaginary numbers and some queries'
Hi, I was watching the following video. I found some points confusing. Could you please help me to understand the gaps? Thanks, in advance! Question 1: Around 4:22, the video says the following. So for those mathematicians, negative numbers didn't exist. You could subtract, that is find the difference between two positive quantities, but you couldn't have a negative answer or negative coefficients. Mathematicians were so averse to negative numbers that there was no single quadratic...
Thread 'Unit Circle Double Angle Derivations'
Here I made a terrible mistake of assuming this to be an equilateral triangle and set 2sinx=1 => x=pi/6. Although this did derive the double angle formulas it also led into a terrible mess trying to find all the combinations of sides. I must have been tired and just assumed 6x=180 and 2sinx=1. By that time, I was so mindset that I nearly scolded a person for even saying 90-x. I wonder if this is a case of biased observation that seeks to dis credit me like Jesus of Nazareth since in reality...
Back
Top