- Home /
knowing 2 vector3, find the 3rd vector3.
How to find Vector3 of C, if we know Vector3 of the A and B. It is a right triangle.
that is the first thing I tried, but It is almost like hard coding. if A is an object and A has a rotation, the C would be incorrect. let me see if I can add additional pictures
That's only true with the assumption that A and B lie on z=0 plane.
Well, the way the problem is presented it seems to be a 2d problem. We are not here to do the work for others. If you use a different plane you should be able to adapt the given information. As it has been mentioned several times, the question is lacking a lot of details which are required to completely answer this question
Answer by sSuite · Dec 04, 2018 at 06:28 AM
There are an infinite number of possible points that could satisfy that -- for example:
If you mean you always want the point where the legs are perfectly vertical and horizontal, you could do this:
Vector3 c = new Vector3(b.x, a.y, 0f);
Correct. This fact is covered by Thales's theorem. So if you connect two points (A and B) and draw a circle around those, all points on that circle will form a right angle when you connect it to A and B.
Answer by Favouriteless · Dec 04, 2018 at 03:01 PM
It would depend if the triangle is always the same rotation.
You can replace B's Y value with A's Y value if the triangle is always the same rotation but if the triangle is not always at that rotation you may need to replace the A's values etc.
sSuite however is correct but I think you meant what I just said, not his answer.
sSuite mentioned already what you said at the end of his answer. That's also what fafase already mentioned in the comment above but the OP replied that's see$$anonymous$$gly not what he wants. So we can't answer this question any more correct as the question isn't clear to begin with. $$anonymous$$aybe he want his right triangle to be aligned with a certain object. However if that's the case he should mention it in the question because as it stands sSuite is right, there are infinitely many points that form a 90° angle.
Answer by GamitusLabs · Dec 04, 2018 at 04:41 PM
The wording of the question is a bit on the bad side. However, it looks as if they are asking how to get the position of C.
It also looks as if they are assuming that the right angle is at C.
If I'm remembering my maths right, it is impossible to calculate the position of C, unless as @PizzaPie stated, the X or Y of C are on the same axis of A or B. Otherwise you need to know the length of one additional side (or one of the other angles?).
Maybe this'll help them out: https://www.mathsisfun.com/algebra/trig-finding-angle-right-triangle.html