Professional Documents
Culture Documents
Pythagorean Theorem: BC SQR (AB 2 + AC 2)
Pythagorean Theorem: BC SQR (AB 2 + AC 2)
This a program that can solve geometric problems based on Pythagorean Theorem. We suppose everybody is already familiar with the above Theorem. However, some of you might have forgotten this theorem. So, let us list the formula here. By referring to a right angled triangle AB , if the sides are AB, A and A respectively, where A is the hypotenuse, then AB, A and B are connected by the formula AB!"A !#B ! $sing the above formula, you can calculate the third side if the the length of any two sides are %now. &or e'ample, if AB#( and A #) then B #*. We have designed the +B program for the user to input any two sides and then he or she is able to calculate the third side automatically. The third side B can be found by finding the s,uare root of AB !"A ! . -n visual basic, the synta' is BC= Sqr(AB ^ 2 + AC ^ 2) We can also the function Round to round the value to two decimal places using the synta' Round(BC, 2). The Interfa e
2im AB, A , B A B
-f AB 34 5 And A B
34 5 Then 6 !1
# S,r0AB 6 ! " A
T't/B .Te't # 7ound0B , !1 8lse-f AB 34 5 And B 34 5 Then A # S,r0B 6 ! 9 AB 6 !1 34 5 Then 6 !1 T't/A .Te't # 7ound0A , !1 8lse-f A 34 5 And B 6!9A AB # S,r0B 8nd -f 8nd Sub
T't/AB.Te't # 7ound0AB, !1