Search code examples
javascriptmathorientationtriangular

How to get a Right Triangle's points' coordination in the space?


I have a Right Triangle with equal legs of 1 unit long rotated on 3 individual angles in the space like in the picture below:

Triangle's Picture

As could be seen in the picture, the input I have are the angles 'a' and 'b' which rotates the triangle in the space and move it to orientation 1 which is "Red Triangle in the picture" (The triangle is still laying on the z-axis), then it rotates on one of it's Legs ('c' angle) and turns to the second orientation which is "The Green Triangle in the picture".

Also, the Right corner is located on (0,0,0).

Here is my question:

How in simple mathematics, can I get the 2 coordination (marked in blue in the picture) for the green triangle, in x, y and z?

I need it to be in simple mathematics so I can easily code it in JavaScript.


Solution

  • Never mind.

    I just reviewed my triangular knowledge and solved the problem with the most basic functions including Sine, Cosine and ArcTangent!

    Now I have the points in the space!