If i have a points a and b in 3d space and i want to move b n units closer to a how do i determine how much to change b's x y and z values?
How to move a specific distance along a line determined by 2
points in 3d space!
Specific distance = m
Distance between the 2 points = D
Distance to move along line from Point #2 toward Point #1 =
Displacement = m
Determine the coordinates of the point M (c, d, e), which is m
units closer to Point#2
Given 2 points
Point #1 (a, b, c)
Point #2 (g. h, i)
1. Find the distance between the 2 points using Pythagorean
Theorem
Think of moving from Point #1 to Point #2 by moving along the
x-axis, then the y-axis, then the z-axis.
(g-a) = distance moved along the x-axis
(h-b) = distance moved along the y-axis
(i-c) = distance moved along the x-axisS
D = [(g-a)^2 + (h-e)^2 + (i-c)^2]^0.5
2. Determine the coordinates of the unit vector by dividing the
distance moved along each axis by D.
Coordinates of unit vector = [(g-a) ÷ D], [(h-b) ÷ D], [(i-c) ÷
D]
x coordinate of unit vector = (g-a) ÷ D
y coordinate of unit vector = (h-b) ÷ D
z coordinate of unit vector = (i-c) ÷ D
Unit vector = [((g-a) ÷ D)^2 + ((h-e) ÷ D) ^2) + ((i-c) ÷ D)
^2]^0.5) = 1
If the value of the unit vector does not =1, go back and check
your work.
3. Multiply each coordinate of the unit vector by m to determine
the coordinates of the vector m. These coordinates will be added to
coordinates of Point #1 to determine the coordinates of Point
#3.
x coordinate of m vector = m * (g-a) ÷ D
y coordinate of m vector = m * (h-b) ÷ D
z coordinate of m vector = m * (i-c) ÷ D
4. To determine the coordinates of Point #3(d, e, f) that is m
cm from Point #1 toward Point #2, add the coordinates of the m
vector to the coordinates of Point #1.
d = x coordinate of Point #3 = a + (m * (g-a) ÷ D)
e = y coordinate of Point #3 = b + (m * (h-b) ÷ D)
f = z coordinate of Point #3 = c + (m * (i-c) ÷ D)
5. To determine the distance from Point #1 (a, b, c) to Point #3
(d, e, f), use Pythagorean Theorem
D = [(d-a)^2 + (e-b)^2 + (f-c)^2]^0.5
The answer should be m.
I wanted to move 2 cm from Point #1 toward Point #2, and I
did.
Now let's see if this method works!! Point #1 = (2,3,1), Point
#2 = (6,9,3)
I want to move 2 cm from Point #1 toward Point #2, that means m
= 2 cm.
1. Find the distance between the 2 points using Pythagorean
Theorem
D = [(g-a)^2 + (h-e)^2 + (i-c)^2]^0.5
D = [(6-2)^2 + (9-3)^2 + (3-1)^2]^0.5
D = [(4)^2 + (6)^2 + (2)^2]^0.5
D = [16 + 36 + (4)]^0.5
D = 56^0.5
D = 7.4833
So the line between these Point #1 and Point #2 is 7.483 units
long
2. Determine the coordinates of the unit vector by dividing the
distance moved along each axis by D.
Distance moved along x-axis = 4
Distance moved along y-axis = 6
Distance moved along z-axis = 2
x-coordinate of unit vector = 4 ÷ 7.4833 = 0.5345
y-coordinate of unit vector = 6 ÷ 7.483 = 0.8018
z-coordinate of unit vector = 2 ÷ 7.483 = 0.2673
Length of unit vector = [(0.5345)^2 + (0.8018)^2+
(0.2673)^2]^0.5 = 1
The length of the unit vector should = 1
3. Multiply each coordinate of the unit vector by m to determine
the coordinates of the vector m.
x coordinate of m vector = m * (g-a) ÷ D = 2 * 0.5345 =
1.069
y coordinate of m vector = m * (h-b) ÷ D = 2 * 0.8018 =
1.6036
z coordinate of m vector = m * (i-c) ÷ D = 2 * 0.2673 =
0.5346
m vector = [1.069^2 + (1.6036)^2 + (1.5346)^2]^0.5 = 2
4. To determine the coordinates of the Point #3 (d, e, f) that
is m cm from Point #1 toward Point #2, add the coordinates of the m
vector to the coordinates of Point #1 (a, b, c).
Point #1 = (2, 3, 1)
x coordinate of Point #3 = 2 + 1.069 = 3.069
y coordinate of Point #3 = 3 +1.6036 = 4.6036
z coordinate of Point #3 = 1+ 0.5346 = 1.5346
Point #3 = (3.069, 4.6036, 1.5346)
5. To determine the distance from Point#1 to Point #3, use
Pythagorean Theorem
D = [(d-a)^2 + (e-b)^2 + (f-c)^2]^0.5
D = [(3.069-2)^2 + (4.6036-3)^2 + (1.5346-1)^2]^0.5
D = [(1.069)^2 + (1.6036)^2 + (0.5346)^2]^0.5 = 2
D = 2 cm
I wanted to move 2 cm from Point #1 toward Point #2, and I
did.