Visual Basic, Calculate area of a Pentagon

media%2F2e2%2F2e263d36-716d-4e20-b5f7-2bba1072b39a%2FphpSVcxdU.png


1) Make sure the entered values are positive integers
2) Make sure you have five different points
3) Please use ActiveForm to know the width and height of the form where the pentagon is drawn. The five points should be less than width and height of the form.
4) Any three points should not be on the same line.
Basically, we are checking that the slopes between point 1 and point 2 and point 1 and point 3 match. Slope is change in y divided by change in x, so we have:
y1 - y2 y1 - y3
------- = --------
x1 - x2 x1 - x3
Cross multiplying gives (y1 - y2) * (x1 - x3) == (y1 - y3) * (x1 - x2);
 

Thống kê

Chủ đề
100,845
Bài viết
467,739
Thành viên
339,893
Thành viên mới nhất
Gia dụng Việt Anㅤ
Top