Function linearInterpo(x1 As Double, x2 As Double, y1 As Double, y2 As Double, x As Double) As Double
Dim y As Double
y = y1 + (x - x1) * (y2 - y1) / (x2 - x1)
linearInterpo = y
End Function
Function varianceInterpo(x1 As Double, x2 As Double, y1 As Double, y2 As Double, x As Double)
Dim y As Double
y = (linearInterpo(x1, x2, y1 ^ 2, y2 ^ 2, x)) ^ (0.5)
varianceInterpo = y
End Function
Sub test()
Dim x As Double
Dim y1 As Double
Dim y2 As Double
Dim i As Integer
For i = 0 To 20
x = 1# + 0.1 * i
y1 = linearInterpo(1, 3, 1, 10, x)
Debug.Print (CStr(x) & " " & CStr(y1))
Next
For i = 0 To 20
x = 1# + 0.1 * i
y2 = varianceInterpo(1, 3, 1, 10, x)
Debug.Print (CStr(x) & " " & CStr(y2))
Next
For i = 0 To 20
x = 1# + 0.1 * i
y2 = varianceInterpo(1, 3, 1.1, 10.1, x)
Debug.Print (CStr(x) & " " & CStr(y2))
Next
End Sub
Sub test2()
MsgBox "a" & vbCrLf & "b"
End Sub
*メニュー
最新の20件
2018-04-17
2012-01-07
2011-12-07
2011-11-03
2011-10-20
2011-10-18
2014-07-13
2013-08-10
2012-01-26
2012-01-25
2012-01-24
2012-01-23
2012-01-21
2012-01-20
2012-01-19
2012-01-17
2012-01-14
2012-01-13
2012-01-09
人気の10件
- counter: 992
- today: 1
- yesterday: 1
- online: 3