• 0

C# Math Help Needed, finding point for Right Triangle?


Question

I am having a heck of a time trying to solve what I thought was a simple math problem in a performant way. I am terrible at explaining, so I am hoping this picture can explain it best. Trying to solve for x on the last point based on the angle.

 

mathDiagram.jpg

Link to comment
Share on other sites

9 answers to this question

Recommended Posts

  • 0

I think I understand your picture now.

 

The (invisible) side is slanting 315 degress, with reference to the diagram below:

 

degrees-360.gif

 

I'm guessing this would mean it's an Isosceles Right Triangle (http://mathworld.wolfram.com/IsoscelesRightTriangle.html):

 

x1=5,y1=10

 

IsoscelesRightTriangle_1000.gif

x2=5,y2=1                                         x3,y3=1

 

Based on this, I'd say x3=14 (as BC=AC).

Link to comment
Share on other sites

  • 0

If I understand your picture correctly (which I don't understand what you mean by angle=315 degrees, as per the statement by the previous poster), you cannot solve for X because there is not enough information. If you had the length of two of the sides then you could solve for the third side, but only knowing two of the points it's impossible to solve for the 3rd.

 

Given the information we do have, X could be anything from 6 to infinite and it would still be a triangle.

 

What is 315 the angle of?

Link to comment
Share on other sites

  • 0

You can't have an angle of 315 in a triangle.

 

It is the angle of the line that connects from x?, y1 to x5,y10.. if that makes sense. Basically I need to solve for any angle

If I understand your picture correctly (which I don't understand what you mean by angle=315 degrees, as per the statement by the previous poster), you cannot solve for X because there is not enough information. If you had the length of two of the sides then you could solve for the third side, but only knowing two of the points it's impossible to solve for the 3rd.

 

Given the information we do have, X could be anything from 6 to infinite and it would still be a triangle.

 

So basically I need to keep looping over distance++/-- until y = 1? That is what I am doing now, but I was hoping there was a better way.

Link to comment
Share on other sites

  • 0

It is the angle of the line that connects from x?, y1 to x5,y10.. if that makes sense. Basically I need to solve for any angle

 

So basically I need to keep looping over distance++/-- until y = 1? That is what I am doing now, but I was hoping there was a better way.

Ok, so the angle is an outside measurement of the angle.....which means you know two of the angles. Assuming the bottom-left angle is 90 degrees, the bottom-right angle would be 360-315=45. So now you have one angle of 90, another angle of 45, all that's left is another 45 degree angle. So now you have the angles of 90, 45 and 45.

 

In your specific example, X would be 10 (because the two angles are the same, the left line is the same length as the bottom line, so bottom-right X = top-left Y.

 

Basically your first step is figuring out all the angles in the triangle, once you have that, you can use the angle and one known side to solve for any other side.

 

Take a look at the SIN function.

Link to comment
Share on other sites

  • 0

Just to clarify, this is a right triangle. The angle is the angle of the line that connects that last point not the angle of the triangle. Maybe it is best to word it saying I have

 

point A x=5, y=10

point B x=?, y=1

Angle = random angle between 0 and 365

Link to comment
Share on other sites

  • 0

Take a look over this page, it explains how to do it far better than I can.

 

http://www.mathsisfun.com/sine-cosine-tangent.html

 

To be clear, the random angle, is that the angle on the outside or inside of the triangle? I'm assuming outside, because if it was inside then it could never go over 89 degrees. That being the case, an angle of 315 would mean the triangle has an angle of 45 (in addition to its 90 degree angle). An angle of 330 for example, would mean the triangle has an angle of 30 degrees (in addition to its 90 degree angle).

Link to comment
Share on other sites

  • 0

Take a look over this page, it explains how to do it far better than I can.

 

http://www.mathsisfun.com/sine-cosine-tangent.html

 

To be clear, the random angle, is that the angle on the outside or inside of the triangle? I'm assuming outside, because if it was inside then it could never go over 89 degrees. That being the case, an angle of 315 would mean the triangle has an angle of 45 (in addition to its 90 degree angle). An angle of 330 for example, would mean the triangle has an angle of 30 degrees (in addition to its 90 degree angle).

 

Thank you, that does help quite a bit. I will see if I can come up with a formula for solving x based on that data. I am terrible at math : (

Link to comment
Share on other sites

  • 0

I think I understand your picture now.

 

The (invisible) side is slanting 315 degress, with reference to the diagram below:

 

degrees-360.gif

 

I'm guessing this would mean it's an Isosceles Right Triangle (http://mathworld.wolfram.com/IsoscelesRightTriangle.html):

 

x1=5,y1=10

 

IsoscelesRightTriangle_1000.gif

x2=5,y2=1                                         x3,y3=1

 

Based on this, I'd say x3=14 (as BC=AC).

 

Yes, that is what I am after. Thank you.

Link to comment
Share on other sites

This topic is now closed to further replies.