Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
» Tuyệt Kỹ Đong Giai Chân Kinh (tuyệt Kỹ cua trai)
Thu Aug 23, 2012 5:38 am by Admin

» Tuyệt kỹ cua giai
Thu Aug 23, 2012 5:36 am by Admin

» NETCAT.........
Mon Aug 13, 2012 6:35 am by Admin

» Bảo mật CSDL bằng phương pháp mã hóa.
Tue Apr 17, 2012 10:04 pm by Admin

» Hàm mã hóa MD5 bằng JavaScript
Tue Apr 17, 2012 10:03 pm by Admin

» Giá của món quà
Fri Apr 13, 2012 6:01 am by Admin

» Sẽ chỉ yêu ai?
Fri Apr 13, 2012 6:01 am by Admin

» Cách đọc bảng chữ cái!
Thu Apr 12, 2012 10:37 pm by Admin

» Gắn trojan, keylog, virus vào website, forum
Tue Apr 10, 2012 1:14 am by Admin

Shopmotion


Affiliates
free forum


Các hàm trên tam giác

View previous topic View next topic Go down

Các hàm trên tam giác

Post  Admin on Thu Dec 16, 2010 7:44 am

Code:
 Public Function Distance() As Integer
        Return Math.Sqrt(iY ^ 2 + iX ^ 2)
    End Function
    Public Function Distance(ByVal p As Point) As Integer
        Return Math.Sqrt((p.iX - iX) ^ 2 + (p.iY - iY) ^ 2)
    End Function
    Public Sub DisplayTriangle(ByVal A As Point, ByVal B As Point, ByVal C As Point)
        If (A.Distance(B) + B.Distance(C)) > A.Distance(C) Then
            WriteLine("Triangle have 3 Points A({0},{1}) B({2},{3}) C({4},{5})", A.iX, A.iY, B.iX, B.iY, C.iX, B.iY)
        Else
            WriteLine("Please enter again 3 Points...")
        End If
    End Sub
    Public Function P(ByVal A As Point, ByVal B As Point, ByVal C As Point) As Integer
        Dim dAB As Integer = A.Distance(B)
        Dim dBC As Integer = B.Distance(C)
        Dim dAC As Integer = A.Distance(C)
        Return (dAB + dAC + dBC)
    End Function
    Public Function Area(ByVal A As Point, ByVal B As Point, ByVal C As Point) As Double
        Dim dAB As Integer = A.Distance(B)
        Dim dBC As Integer = B.Distance(C)
        Dim dAC As Integer = A.Distance(C)
        Dim p As Integer = (dAB + dAC + dBC) / 2
        Return Math.Sqrt(p * (p - dAB) * (p - dBC) * (p * dAC))
    End Function

Admin
Admin

Tổng số bài gửi : 782
Join date : 2009-08-15

View user profile http://hackis.forumotion.com

Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum