# Finding the MidPoint of a Right Angle triangle

I have a rather simple question, not sure if this is in the right SO.

I am attempting to find the angle of a side of a right angle triangle. And also attempting to find the mid point of a right angle triangle no matter the rotation(for a webapp I am making). I am attempting to find the angle where the question mark is, then test that my algorithm/methodology to find the position of the mid point of a shape works(this is for my HTML5 Canvas Web App).

Is my maths correct?...

````// This is half code/mathematics
? = tan-1( opposite/adjacent );  // inverse tan
? = tan-1(50/25);
? = 63.43; // is that correct??
````

My math algorithm below attempts to find the mid point when a shape is rotated. In my webapp I will only ever know the x,y pos & the width & height, but it will also be rotated around the x,y point which means the midpoint can be different. Is it correct?

````// To find the x,y midpoint all I have to do is have   
// the hypotenuse of the triangle & the angle of one   
// side(the angle I found above). Is that correct?

// h stands for hypotenuse, a stands for the angle I found above
midX = cos(a)*h
midY = sin(a)*h

// so to take the example above, if I use those formulas I should get an mid x,y value of 25,12.5
midX = cos(63.4)*75;
     = 33.58; // shouldn't this be 25?
midY = sin(63.4)*75;
     = 67.06; // should be 12.5?
````
-

2
Are you interested in finding the "mid-point" of the triangle that is invariant under rotation or find mid points of sides? – user21436 Jan 26 '12 at 1:46

2
– Henry Jan 26 '12 at 1:51
@Henry thanks for the confirmation. I have added more info about the mid points, its really just x=half width, y=half height. – Jake M Jan 26 '12 at 2:16
In order to provide an answer, can you tell us the the dimensions of the first triangle? Also, let me know if I understand, if a triangle have width=(0,0)--(0,1) and height=(0,0)--(0,-1), the midpoint that you want is (0.5,-0.5), do am I right? – leo Jan 26 '12 at 4:01

## 1 Answer

$63.43^\circ$ is correct to two decimal places.

Your midpoint seems to be halfway along the hypotenuse (the circumcentre of a right angled triangle), rather than being inside the triangle. The hypotenuse has length $\sqrt{50^2+25^2} \approx 55.90$ so half of that is about $27.95$.

So for a given angle $\theta$, the coordinates are about $(27.95 \sin \theta, 27.95 \cos \theta)$.

Plug in the angle you found earlier and you get $(25,12.5)$ within rounding errors

-
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 6, "mathjax_display_tex": 0, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.8859899044036865, "perplexity_flag": "middle"}