Построить треугольник по 3 заданным сторонам- Basic(Бейсик)

SCREEN 12
 
a = 600
b = 305
c = 300
 
IF a > b THEN
t = a
a = b
b = t
END IF
 
IF a > c THEN
t = a
a = c
c = t
END IF
 
IF b > c THEN
t = b
b = c
c = t
END IF
 
 
P = (a + b + c) / 2
S = SQR(P * (P - a) * (P - b) * (P - c))
Y = 2 * S / c
X = SQR(b * b - Y * Y)
 
LINE (0, 0)-(c, 0), 2
LINE (0, 0)-(X, Y), 5
LINE (c, 0)-(X, Y), 7
 
CIRCLE (0, 0), b
CIRCLE (c, 0), a

Leave a Comment