SFML community forums

Help => General => Topic started by: aaranaf on August 03, 2013, 01:23:52 am

Title: Math: Finding a point that is perpendicular to another point.
Post by: aaranaf on August 03, 2013, 01:23:52 am
So here's what I want to do. I want to find the point in 2d-space for C.
I have the point A and B and the distance from B to C.
I know C is perpendicular to B. If someone could point me in the right direction on this it would be greatly appreciated.
(http://imageshack.us/a/img849/6741/0lpj.png)
Title: Re: Math: Finding a point that is perpendicular to another point.
Post by: The Hatchet on August 03, 2013, 02:08:38 am
Go to google and put in "find point perpendicular to line"
Title: Re: Math: Finding a point that is perpendicular to another point.
Post by: rgrant1993 on August 03, 2013, 08:25:55 pm
We need to know the data you have recorded inorder to know the data we need to find.
Title: Re: Math: Finding a point that is perpendicular to another point.
Post by: Grimshaw on August 03, 2013, 08:37:41 pm
(direction from A to B)
V = B - A
V' = normalize(V)

(vector orthogonal to V' - perpendicular)
O = (-V'y, V'x)

(finally find point C by going from B in the orthogonal direction)
C = B + O * distance

I am a little fuzzy right now but if something is wrong here ill get back to you
Title: Re: Math: Finding a point that is perpendicular to another point.
Post by: gostron on August 05, 2013, 01:02:44 pm
May I add that knowing the distance and that it's perpendicular gives your two points, one for each side.

for a vector defined by (a,b) an orthogonal vector would be (-b, a) (so I do agree with Grimshaw, just to say it a bit differently)