Function piVBA() As Double Dim pi As Double piVBA = 4 * Atn(1) End Function Function sinhVBA(RAD As Double) As Double 'https://www.vba-ie.net/function/exp.php sinhVBA = (Exp(RAD) - Exp(-1 * RAD)) / 2 End Function Function coshVBA(RAD As Double) As Double 'https://www.vba-ie.net/function/exp.php coshVBA = (Exp(RAD) + Exp(-1 * RAD)) / 2 End Function Function tanhVBA(RAD As Double) As Double 'https://www.vba-ie.net/function/exp.php tanhVBA = sinhVBA(RAD) / coshVBA(RAD) End Function Function asinVBA(x As Double) 'http://tancro.e-central.tv/grandmaster/excel/vba-function-triangle.html If x <= -1 Then asinVBA = 3 * piVBA() / 2 ElseIf x >= 1 Then asinVBA = piVBA() / 2 Else asinVBA = Atn(x / Sqr(1 - x ^ 2)) End If End Function Function acosVBA(x As Double) 'http://tancro.e-central.tv/grandmaster/excel/vba-function-triangle.html If x <= -1 Then acosVBA = piVBA() ElseIf x >= 1 Then acosVBA = 0 Else acosVBA = Atn(-x / Sqr(-x ^ 2 + 1)) + piVBA() / 2 End If End Function Function atanhVBA(x As Double) 'http://tancro.e-central.tv/grandmaster/excel/vba-function-triangle.html If x <= -1 Then atanhVBA = 0 ElseIf x >= 1 Then atanhVBA = 0 Else atanhVBA = 1 / 2 * Log((1 + x) / (1 - x)) End If End Function Function y座標VBA(ZOOM As Long, 緯度十進 As Double, 経度十進 As Double) As Double Dim t2 As Double t2 = 2 ^ (ZOOM + 7) / piVBA() * (-atanhVBA(Sin(piVBA() / 180 * 緯度十進)) + atanhVBA(Sin(piVBA() / 180 * 85.05112878))) y座標VBA = t2 End Function Function x座標(ZOOM As Long, 緯度十進 As Double, 経度十進 As Double) As Double Dim t1 As Double t1 = Int(2 ^ (ZOOM + 7) * (経度十進 / 180 + 1) Mod 256) x座標 = t1 End Function Function xタイル(ZOOM As Long, 緯度十進 As Double, 経度十進 As Double) As Long Dim t1 As Double t1 = Int(2 ^ (ZOOM + 7) * (経度十進 / 180 + 1) / 256) xタイル = t1 End Function Function yタイル(ZOOM As Long, 緯度十進 As Double, 経度十進 As Double) As Long Dim t2 As Double t2 = Int(2 ^ (ZOOM + 7) / WorksheetFunction.pi() * (-WorksheetFunction.Atanh(Sin(WorksheetFunction.pi() / 180 * 緯度十進)) + WorksheetFunction.Atanh(Sin(WorksheetFunction.pi() / 180 * 85.05112878))) / 256) yタイル = t2 End Function