# Calculating a vertex along a line of known length

This topic is 4171 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Hopefully this should be a simple problem to solve! I have two verticies v1 & v2 which define a 3D line (a line-of-sight). I want the length of the line be constant; so when (for example) the vertex v1 changes, I want to adjust v2 so that the lines length is back to its default value. I can think of a couple of ways of doing this (using the delta value of the line-slope to move the a vertex along its length, etc), but this seems very in-elegant, and Im sure that there is a much better (& simpler!) way of achieving this. Im sure that Ill be kicking myself when someone points out the solution, (and folly!), but hey, what are forums for, eh?! Thanks in advance, BenE.

##### Share on other sites
Just update v2 by the same quantity you update v1 by.

if v2-v1 = R then (v2+A)-(v1+A)=v2-v1+A-A=v2-v1=R

So:
v1 += some_vector;
v2 += some_vector;

1. 1
2. 2
3. 3
Rutin
22
4. 4
5. 5

• 11
• 18
• 14
• 9
• 9
• ### Forum Statistics

• Total Topics
632929
• Total Posts
3009281
• ### Who's Online (See full list)

There are no registered users currently online

×