- #1
Tommaso_Russo
- 13
- 0
Ciao to everybody,
I've encountered frequently, in forums and news groups, questions about a rectangle inscribed in another rectangle, but nowhere a general discussion on ways to solve related problems (i.e., given three of the five quantities involved - 2 sides of outer rectangle, 2 sides of inner rectangle, and one of the two complementary angles between them - compute remaining two, or state that the problem has no solution).
Probably the problem is felt too trivial to encourage somebody to afford difficulties - really NOT trivial - that are encountered in some of these cases.
I did it, and attach below my solutions and some Fortran 95 subroutines and programs that allow for finding unknowns in each case - or for stating that the problem, with input data given, has no solution.
I attach them as text files because proper formatting is relevant for text and essential to code.
(Note: endlines unix style - under Windows use Notepad2 or Scite, not Notepad.)
Hope this will help somebody in future.
Of course, observations, corrections, and suggestions for improvements, are welcome.
Code has been written by myself and I release it in the public domain.
june 2011
Tommaso Russo, Trieste(Italy)
Rectangle inscribed in another rectangle: solutions for all cases.
==================================================================
View attachment InscribedRectangles-discussion.txt
Appendix
========
Subroutines and test programs (Fortran 95):
-------------------------------------------
View attachment InscribedRectangles-fortran95code.txt
--
TRu-TS
I've encountered frequently, in forums and news groups, questions about a rectangle inscribed in another rectangle, but nowhere a general discussion on ways to solve related problems (i.e., given three of the five quantities involved - 2 sides of outer rectangle, 2 sides of inner rectangle, and one of the two complementary angles between them - compute remaining two, or state that the problem has no solution).
Probably the problem is felt too trivial to encourage somebody to afford difficulties - really NOT trivial - that are encountered in some of these cases.
I did it, and attach below my solutions and some Fortran 95 subroutines and programs that allow for finding unknowns in each case - or for stating that the problem, with input data given, has no solution.
I attach them as text files because proper formatting is relevant for text and essential to code.
(Note: endlines unix style - under Windows use Notepad2 or Scite, not Notepad.)
Hope this will help somebody in future.
Of course, observations, corrections, and suggestions for improvements, are welcome.
Code has been written by myself and I release it in the public domain.
june 2011
Tommaso Russo, Trieste(Italy)
Rectangle inscribed in another rectangle: solutions for all cases.
==================================================================
View attachment InscribedRectangles-discussion.txt
Appendix
========
Subroutines and test programs (Fortran 95):
-------------------------------------------
View attachment InscribedRectangles-fortran95code.txt
--
TRu-TS