call COS_MIN(r_ugol1,r_ugol2,r_ugol3)
goto 6
else!treugol'nik opredelyaetcya !!!NE!!! odnozna4no
raa = r_ugol2*180/pi
if(raa.eq.90) then !!!est' slu4ai,kogda opr-cyaodnozna4no : ugol (2-ya^3-ya)=90)
call COS_MIN(r_ugol1,r_ugol2,r_ugol3)
goto 6
else
print *,'2a min_ugla:'
call COS_MIN(r_ugol1,r_ugol2,r_ugol3)
call COS_MIN(r_ugol1,r_ugol21,r_ugol31)
goto 6
endif
endif
5 end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c proverka na korrektnost
subroutine proverka(n)
common /tri_in/ side1,side2,ugol
common /tri_out_ugol/ r_ugol1,r_ugol2,r_ugol3,r_ugol21,r_ugol31,
* r_ugolmin
n=1
if (side1.le.0) then !sleim,4toby storona ne byla < 0
n=0
print *,'otricanelnaya 1-ya storona'
pause
endif
if (side2.le.0) then!sleim,4toby storona ne byla < 0
n=0
print *,'otricanelnaya 2-ya storona'
pause
endif
if (ugol.le.0) then !sleim,4toby ugol E (0,180)
n=0
print *,'ugol doljen E (0,180)'
pause
endif
if(ugol.ge.180) then
n=0
print *,'ugol doljen E (0,180)'
pause
endif
q = side1*sin(r_ugol1)
if(side2.lt.q) then !sleim,4toby triugolnik E-val
n=0
print *,'takoi treugolnik !E'
pause
endif
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c vvod dannuh
subroutine vvod()
common /tri_in/ side1,side2,ugol
common /tri_out_ugol/ r_ugol1,r_ugol2,r_ugol3,r_ugol21,r_ugol31,
* r_ugolmin
common /pi/ pi
print *,'vvedite 2 storoni i ugol mejdu 1-oj i ost stor'
read *,side1,side2,ugol
pi = 3.141592653
r_ugol1=ugol*pi/180.0
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c nahodim min ugol iz 3-h tirvial'num algo
subroutine min(z1,z2,z3,zz)
if (z1.lt.z2) then
if (z1.lt.z3) then
zz=z1
else
zz=z3
endif
else
if (z2.lt.z3) then
zz=z2
else
zz=z3
endif
endif
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c nahodim cos min ugla
subroutine COS_MIN (z1,z2,z3)
real zz
call min(z1,z2,z3,zz) !nahodim min ugol
print *,'COS(MIN)=',cos(zz)
pause
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c vy4isltyaem ploshad po 2-m storonam i uglu mejdu nimi
subroutine ploshad(a,b,z3,s)
s=a*b*sin(z3)/2.0
end
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
c vy4islyaem ostal'nye ugly
subroutine ost_ugly()
common /tri_out_ugol/ r_ugol1,r_ugol2,r_ugol3,r_ugol21,r_ugol31,
* r_ugolmin
common /pi/ pi
common /tri_in/ side1,side2,ugol
y = sin(r_ugol1)
x = side1*y/side2
r_ugol2 = asin(x)
r_ugol3 = pi - r_ugol2 - r_ugol1
if(side1.gt.side2) then
r_ugol21 = pi - r_ugol2
r_ugol31 = pi - r_ugol21 - r_ugol1
endif
end
Тесты
Сторона |
Сторона |
Угол |
Результат |
||
Площадь |
Минимальный угол |
Косинус минимального угла |
|||
-1 |
2 |
30 |
otricanelnaya 1-ya storona |
||
1 |
-2 |
30 |
otricanelnaya 2-ya storona takoi treugolnik !E |
||
1 |
1 |
190 |
ugol doljen E (0,180) |
||
1 |
1 |
60 |
0,4330127 |
60 |
0,5 |
20 |
30 |
45 |
287,0828552 |
28,1255054 |
0,8819171 |
5 |
3 |
55 |
takoi treugolnik !E |
||
5 |
3 |
30 |
7,4855494 5,5140814e-39 |
30 4,2124478e-38 |
0,8660254 1 |
2,3 |
3 |
45,9 |
3,3400776 |
33,4056778 |
0,8347933 |
3 |
5 |
90 |
6 |
36,8698959 |
0,8 |
1 |
3 |
0 |
ugol doljen E (0,180) |
||
1 |
3 |
180 |
ugol doljen E (0,180) |
||
1 |
1 |
-30 |
ugol doljen E (0,180) |
Уважаемый посетитель!
Чтобы распечатать файл, скачайте его (в формате Word).
Ссылка на скачивание - внизу страницы.