- Home /
Find third point resulting in a right angle triangle with 2 known points
Hi, I want to find a point in 3d space ( Point C ) which creates right angle with point a and point b, as point a and point b are known and fixed so as the length x, Length Y is also fixed Hence the point c can lay on the grey circle maintaining the fixed distance form point b but also creating right angle triangle. I think it is a mathf tan cos problem but dont know how to implement. Points are Vector 3 in 3d space. Thankyou for your time to solve this question.
there are million posible points in the 3d space, you want any of those?
I Figured out the solution using trigonometry.
Answer by UnderShad · Dec 03, 2020 at 08:56 PM
Here is the main solution:
float radian = Mathf.Asin(Y/X);
Vector3 DirectionVector=(A-B).normalized;
Vector3 NormalOfPlaneOfTriangle = known;
DirectionVector = Quaternion.AngleAxis(-radian
*Mathf.Rad2Deg,NormalOfPlaneOfTriangle)*DirectionVector;
//now the directionVector have the direction of (c-a).normalized where c is point to find
//now we can project point b on DirectionVector
Vector3 PointC = Vector3.Project((B-A),DirectionVector)+A;
Feel free to ask if there is any problem
You are overcomplicating this. If static just use the the x value from point a and the y value from point b.
Edit : Sorry its late
If you are trying to find the point on the circumference dynamically it's: x = r * cos(theta)
and y = r * sin(theta)
I have to find the third point in 3d space where the 2 points and the normal of the plane (at which all three points lie) can be at any orientation not just on x,y axis. So it would need z axis too. $$anonymous$$y current solution is very accurate.
Your answer
Follow this Question
Related Questions
How to get point a set distance along a direction 1 Answer
How to get a point that's inside a collider relative to the point a raycast hit 0 Answers
How to get a point along an object x distance away from its pivot 1 Answer
How to get a vector3 (postion) 1 unit away from another in the direction of a 3rd vector3? 2 Answers
Failed setting triangles in my mesh 1 Answer