POLIGON DALAM
Function gx(x)
gx = x * x + x - 6
End Function
Sub PoligonDalam()
a = Cells(1, 1)
b = Cells(1, 2)
n = Cells(1, 3)
DeltaX = (b - a) / n
L = 0
i = 1
Do
Li = DeltaX * gx(a + (i - 1) * DeltaX)
L = L + Li
i = i + 1
Loop While i <= n
Cells(2, 1) = "Luas adalah"
Cells(2, 2) = L
End Sub
POLIGON LUAR
Function hx(x)
hx = x ^ 2 + x - 6
End Function
Sub PoligonLuar()
a = Cells(1, 1)
b = Cells(1, 2)
n = Cells(1, 3)
DeltaX = (b - a) / n
L = 0
i = 1
Do
Li = DeltaX * hx(a + (i) * DeltaX)
L = L + Li
i = i + 1
Loop While i <= (n + 1)
Cells(2, 1) = "Luas adalah"
Cells(2, 2) = L
End Sub
Function gx(x)
gx = x * x + x - 6
End Function
Sub PoligonDalam()
a = Cells(1, 1)
b = Cells(1, 2)
n = Cells(1, 3)
DeltaX = (b - a) / n
L = 0
i = 1
Do
Li = DeltaX * gx(a + (i - 1) * DeltaX)
L = L + Li
i = i + 1
Loop While i <= n
Cells(2, 1) = "Luas adalah"
Cells(2, 2) = L
End Sub
POLIGON LUAR
Function hx(x)
hx = x ^ 2 + x - 6
End Function
Sub PoligonLuar()
a = Cells(1, 1)
b = Cells(1, 2)
n = Cells(1, 3)
DeltaX = (b - a) / n
L = 0
i = 1
Do
Li = DeltaX * hx(a + (i) * DeltaX)
L = L + Li
i = i + 1
Loop While i <= (n + 1)
Cells(2, 1) = "Luas adalah"
Cells(2, 2) = L
End Sub
0 tanggapan:
Posting Komentar