Sub Process_Globals
Type tAreaParam1(Base As Double, Altezza As Double)
Type tAreaParam2(X1 As Double, Y1 As Double, _
X2 As Double, Y2 As Double, _
X3 As Double, Y3 As Double _
)
End Sub
Public Sub Area(Param As Object) As Double
Dim Result As Double
If Param Is tAreaParam1 Then
Dim AreaParam1 As tAreaParam1 = Param
Result = AreaParam1.Base * AreaParam1.Altezza * 0.5
Else If Param Is tAreaParam2 Then
Dim AreaParam2 As tAreaParam2 = Param
Result = 0.5 * (AreaParam2.x1 * AreaParam2.y2 _
+ AreaParam2.y1 * AreaParam2.x3 _
+ AreaParam2.x2 * AreaParam2.y3 _
- AreaParam2.x3 * AreaParam2.y2 _
- AreaParam2.y3 * AreaParam2.x1 _
- AreaParam2.x2 * AreaParam2.y1)
End If
Return Result
End Sub