VERSION 5.00
Begin VB.Form HBSpeed 
   BackColor       =   &H00808000&
   Caption         =   "H_L"
   ClientHeight    =   7770
   ClientLeft      =   60
   ClientTop       =   345
   ClientWidth     =   7230
   LinkTopic       =   "Form1"
   ScaleHeight     =   7770
   ScaleMode       =   0  'User
   ScaleWidth      =   7757.511
   StartUpPosition =   3  'Windows Default
   Begin VB.PictureBox Picture1 
      BackColor       =   &H00FFFFFF&
      DrawWidth       =   2
      FillColor       =   &H00C000C0&
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   9.75
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   2895
      Left            =   120
      ScaleHeight     =   2835
      ScaleWidth      =   6915
      TabIndex        =   15
      Top             =   4680
      Width           =   6975
   End
   Begin VB.TextBox Text6 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   13
      Top             =   4200
      Width           =   5055
   End
   Begin VB.TextBox Text5 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      BorderStyle     =   0  'None
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   375
      Left            =   360
      TabIndex        =   12
      Top             =   3720
      Width           =   5055
   End
   Begin VB.TextBox Text4 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   615
      Left            =   3600
      TabIndex        =   7
      Top             =   2160
      Width           =   2895
   End
   Begin VB.TextBox Text3 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000FF&
      Height          =   615
      Left            =   360
      TabIndex        =   6
      Top             =   2160
      Width           =   2775
   End
   Begin VB.HScrollBar HScroll2 
      Height          =   375
      Left            =   3600
      Max             =   90
      Min             =   1
      TabIndex        =   4
      Top             =   1560
      Value           =   90
      Width           =   2895
   End
   Begin VB.TextBox Text2 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   615
      Left            =   3960
      TabIndex        =   3
      Top             =   480
      Width           =   2175
   End
   Begin VB.HScrollBar HScroll1 
      Height          =   375
      Left            =   360
      Max             =   100
      TabIndex        =   2
      Top             =   1560
      Width           =   2775
   End
   Begin VB.TextBox Text1 
      Alignment       =   2  'Center
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   615
      Left            =   720
      TabIndex        =   1
      Top             =   480
      Width           =   2055
   End
   Begin VB.CommandButton Command1 
      Caption         =   "Выход"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      Height          =   735
      Left            =   5640
      TabIndex        =   0
      Top             =   3360
      Width           =   975
   End
   Begin VB.Label Label6 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      Caption         =   "Решение"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0080FFFF&
      Height          =   255
      Left            =   2160
      TabIndex        =   14
      Top             =   3360
      Width           =   2055
   End
   Begin VB.Label Label5 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      Caption         =   "Дальность полёта"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   375
      Left            =   3360
      TabIndex        =   11
      Top             =   2880
      Width           =   3375
   End
   Begin VB.Label Label4 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      Caption         =   "Высота полёта"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   13.5
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H000000C0&
      Height          =   375
      Left            =   360
      TabIndex        =   10
      Top             =   2880
      Width           =   2775
   End
   Begin VB.Label Label3 
      Alignment       =   2  'Center
      BackColor       =   &H00808000&
      Caption         =   "Угол бросания"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H00000000&
      Height          =   615
      Left            =   3600
      TabIndex        =   9
      Top             =   1200
      Width           =   2895
   End
   Begin VB.Label Label2 
      BackColor       =   &H00808000&
      Caption         =   "Начальная скорость"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   -1  'True
         Strikethrough   =   0   'False
      EndProperty
      Height          =   615
      Left            =   360
      TabIndex        =   8
      Top             =   1200
      Width           =   2895
   End
   Begin VB.Label Label1 
      Alignment       =   2  'Center
      Appearance      =   0  'Flat
      BackColor       =   &H00808000&
      Caption         =   "Высота и дальность полёта"
      BeginProperty Font 
         Name            =   "MS Sans Serif"
         Size            =   12
         Charset         =   204
         Weight          =   700
         Underline       =   0   'False
         Italic          =   0   'False
         Strikethrough   =   0   'False
      EndProperty
      ForeColor       =   &H0000FFFF&
      Height          =   255
      Left            =   960
      TabIndex        =   5
      Top             =   120
      Width           =   4935
   End
End
Attribute VB_Name = "HBSpeed"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim h, l, k, x, y, i, t, lfcr, info

Private Sub Update1()

lfcr = Chr(13)
info = "Привет"
Text5.Text = info
'Update
info = ""
End Sub

Private Sub Command1_Click()
Beep
End
End Sub

Private Sub Command2_Click()
Text3.Text = Str(Int((HScroll1.Value * Sin(HScroll2.Value / 3.14 * 180)) ^ 2 / 2 / 9.8 * 100) / 100) + " м"

End Sub

Private Sub Command2_KeyDown(KeyCode As Integer, Shift As Integer)
'Text3.Text = Str((HScroll1.Value * Sin(HScroll2.Value / 3.14 * 180)) ^ 2 / 2 / 9.8) + "м"
End Sub

Private Sub Command3_Click()
Text4.Text = Str(Int(Sqr((Int((HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180)) ^ 2 / 2 / 9.8 * 100) / 100) * 2 / 9.8) * Int((HScroll1.Value * Cos(HScroll2.Value * 3.14 / 180) * 100) / 100) * 100) / 100) + " м"

End Sub

Private Sub Form_DblClick()
End
End Sub

Private Sub Form_Load()
Update1
Picture1.Scale (0, 0)-(ScaleWidth, ScaleHeight)
End Sub

Private Sub Form_Resize()
HBSpeed.Cls
Picture1.Left = 200
Picture1.Top = 4500
If ScaleHeight - 4700 > 0 Then Picture1.Height = ScaleHeight - 4700
If ScaleWidth - 500 > 0 Then Picture1.Width = ScaleWidth - 500
If ScaleHeight > 4770 Then Picture1.Scale (0, 0)-(ScaleWidth, ScaleHeight)
HBSpeed.Print ScaleWidth; ScaleHeight
Pic1
End Sub

Private Sub HScroll1_Change()
k = 1
h = Int((HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180)) ^ 2 / 2 / 9.8 * 100) / 100
l = Int((HScroll1.Value * Cos(HScroll2.Value * 3.14 / 180)) * 2 * (HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180) / 9.8) * 100) / 100


Text1.Text = Str(HScroll1.Value) + " м/с"
Text3.Text = Str(h) + " м"
Text4.Text = Str(l) + " м"
Text5.Text = "Высота: h=V0*Sin(a)*t-g*t^2/2"
Text6.Text = "t=2*V0*Sin(a)/g"
Pic1
End Sub

Private Sub HScroll1_Scroll()
HScroll1_Change

End Sub


Private Sub HScroll2_Change()
k = 1
h = Int((HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180)) ^ 2 / 2 / 9.8 * 100) / 100
l = Int((HScroll1.Value * Cos(HScroll2.Value * 3.14 / 180)) * 2 * (HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180) / 9.8) * 100) / 100

Text2.Text = Str(HScroll2.Value) + " град."
Text3.Text = Str(h) + " м"
Text4.Text = Str(l) + " м"
Text5.Text = "Дальность: L=V0*Cos(a)*t"
Text6.Text = "t=2*V0*Sin(a)/g"
Pic1
End Sub

Private Sub HScroll2_Scroll()
HScroll2_Change
End Sub

Private Sub Label1_Click()
End
End Sub

Private Sub Pic1()
t = Sqr(HScroll1.Value * Sin(HScroll2.Value * 3.14 / 180) / 9.8) * 2
Picture1.Cls
Picture1.PSet (100, ScaleHeight - 100)
Picture1.Line Step(0, 0)-Step(ScaleWidth - 150, 0), 1
Picture1.Line Step(0, 0)-Step(-100, 100), 1
Picture1.Line Step(0, 0)-Step(100, -100), 1
Picture1.Line Step(0, 0)-Step(-100, -100), 1
Picture1.PSet Step(0, -650)
Picture1.Print "X"
Picture1.PSet (100, ScaleHeight - 100)
Picture1.Line Step(0, 0)-Step(0, -ScaleHeight + 200), 1
Picture1.Line Step(0, 0)-Step(-50, 100), 1
Picture1.Line Step(0, 0)-Step(50, -100), 1
Picture1.Line Step(0, 0)-Step(50, 100), 1
Picture1.PSet Step(30, 100)
Picture1.Print "Y"

For i = 1 To l Step 1
x = i
y = Int(((Tan(HScroll2.Value * 3.14 / 180)) * x - 9.8 * x ^ 2 / 2 / (HScroll1.Value * Cos(HScroll2.Value * 3.14 / 180)) ^ 2) * 100) / 100
'x = Int((HScroll1.Value) * Cos(HScroll2.Value * 3.14 / 90) * i * 100) / 100
Picture1.PSet (x * ScaleWidth / 1050 + 100, ScaleHeight - y * ScaleHeight / 400 - 100), 255
Next


End Sub

