Option Explicit
Private Const PI As Double = 3.1415926
Private Sub Form_Load()
Const DeltaFi As Double = PI * 3 / 180
Dim Fi0 As Double, Fi As Double, rmax As Double, r As Double
'Dim x As Double, y As Double
Me.BackColor = vbActiveTitleBarText ' а не &H80000009
Me.DrawWidth = 2
Me.Scale (-400000, 400000)-(400000, -400000)
Me.ForeColor = vbBlack 'а не 0&
Me.Line (-1000000, 0)-(1000000, 0)
Me.Line (0, -1000000)-(0, 1000000)
Me.ForeColor = vbRed 'а не &hff
Me.Line (0, 0)-(0, 0)
For Fi0 = 0.000013 To 2 * PI Step DeltaFi
rmax = 0
For Fi = 0.0000137 To 2 * PI Step 0.24351
r = Count_graf(Fi, Fi0) ' получаю число
If r > rmax Then rmax = r
Next
Me.Line -(Cos(Fi0) * rmax, Sin(Fi0) * rmax)
Next
End Sub
Private Function Count_graf(Fi As Double, Fi0 As Double) As Double
Const Fi01 As Double = 3.00034
Const G As Double = 4000
Const E As Double = 300 * (10 ^ 3) * 60 * (10 ^ (-6))
Const sigma As Double = 7
Const rp As Double = 10000
Const Pp As Double = 150 / 1000000
Const Pm As Double = 10 ^ 38 / 1000000
Dim psi As Double, psi1 As Double, F As Double, F1 As Double
psi = 36 * 2.57 * (Cos(Fi - Fi0) - 1)
F = Sin(psi) / psi
psi1 = 36 * 2.57 * (Cos(Fi01 - Fi0) - 1)
F1 = Sin(psi1) / psi1
'формула
Count_graf = (E * G * sigma * (F ^ 4) / (16 * PI * PI * Pm + (4 * 3.14 * Pp * F1 ^ 2) / (rp ^ 2))) ^ (1 / 4)
Debug.Print Count_graf
End Function
Private Type POINTAPI
X As Long
Y As Long
End Type
Private Declare Function Polyline Lib "gdi32" (ByVal hdc As Long, lpPoint As POINTAPI, ByVal nCount As Long) As Long
Polyline Me.hDC, Points(0), UBound(Points) + 1
Сейчас этот форум просматривают: SemrushBot и гости: 107