How can I calculate the perpendicular bisector of a vector?

5.5k Views Asked by At

I have seen questions and examples on how to calculate this which returns an equation, but how would I then apply this equation to calculate the actual vector of the perpendicular bisector?

In my example, I have two points A and B. I have calculated a directional vector from this, and found its midpoint, but how would I calculate the bisector which will give me the vector?

Example

Above is an example of what I'd like to achieve and the vector I'm looking to calculate is C

This is also being applied in three-dimensional space so it's important that the direction is correct.


Following Mohammad Riazi-Kermani example, I have produced a small example in my application which doesn't produce correct results.

Attempt

Image

This doesn't seem to display the correct bisector I am looking for despite the results being accurate?

Vector3 AB = B - A;
Vector3 midpoint = currentPoint + (AB / 2);
Vector3 V = new Vector3(1, 1, 0);
Vector3 W = midpoint + (0 * V);

I have calculated the bisector using the above, where 0 is t, or the step along the vector. I have then drawn the vector from the midpoint which is displayed as a red line. The values for the bisector are

bisector: (3.0, 1.0, 5.0)

Which from the example given seems to be correct but is not drawn correctly.

3

There are 3 best solutions below

8
On BEST ANSWER

If you have $A =(a_1, a_2)$ and $B=(b_1, b_2)$, then $$M= \frac {1}{2} (A+B)= (\frac {1}{2} (a_1+ b_1), \frac {1}{2} (a_2+ b_2)) $$ is the midpoint.

The direction vector of your perpendicular bisector is perpendicular to the vector AB.

Thus it if $\vec {AB} = (b_1 -a_1,b_2 -a_2) $ the direction vector of the bisector is $\vec V=(a_2 -b_2,b_1 -a_1)$

The equation of the perpendicular bisector is then $$ \vec W=M+t\vec V$$

For example,

$A=(1,3,4)$, $B= (5,-1,6)$

$M=(3,1,5)$, $\vec {AB}=<4,-4,2>$

$\vec V = <1,1,0>$

$$ W=M+t\vec V = (3,1,5)+ t <1,1,0>= <3+t,1+t,5>$$

That is $$x=3+t\\y=1+t\\z=5$$

3
On

We have that

  • midpoint $M=\frac{A+B}2$

then we need to find a perpendicular vector $\vec v$ by dot product that is

  • $\vec v \cdot (B-A) =0$

For example, in $\mathbb{R^3}$, if vector $\vec{AB}=B-A=(1,2,3)$ we can find a perpendicular vector $v=(a,b,c)$ by solving $\vec v \cdot \vec {AB}=a+2b+3c=0$ thus we can find infinitely many solution as for example $\vec v=(1,1,-1)$ wich is perpendicular to $\vec {AB}$.

Then the parametric equation of a bisector is given by: $M+t\vec v$.

2
On

Given: $A=[x_1,y_1]$ and $B=[x_2,y_2]$

1- Calculate the midpoint (as you already did) $$Midpoint = [\frac{x_1 + x_2}{2},\frac{y_1 + y_2}{2}] = [x_3,y_3]$$

2- Calculate the slope $$Slope = \frac{y_2 - y_1}{x_2 - x_1}$$

3- Calculate the negative reciprocal of the slope $$NegativeReciprocal = \frac{-1}{slope}$$

4- Given the negative reciprocal and the midpoint, derive the equation for the perpendicular bisector

$midpoint = [x_3,y_3]$

$NewSlope = NegativeReciprocal = \frac{-1}{slope}$

Perpendicular Bisector Equation $$y = m * x + b$$ $$y = NewSlope * x + b$$

Where $b = y_3 - NewSlope * x_3$