powered by simpleCommunicator - 2.0.61     © 2026 Programmizd 02
Целевая тема:
Создать новую тему:
Автор:
Закрыть
Цитировать
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / Построение параболы
2 сообщений из 2, страница 1 из 1
Построение параболы
    #33639860
Masa
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Гость
Привет! Я сейчас готовлю проект для экзамена. (школа). Короче говоря, квадратное уравнение. Я ввожу параметры а,б,с и мне выдает дискременант и корень1, корень2. Как на основе всего этого сделать, чтобы в имайдже или пикчербоксе строилась парабола?
Вот, если что, код моей простенькой проги:

Private Sub cmdCalculate_Click()

' объявляем переменные
Dim paramA As Double
Dim paramB As Double
Dim paramC As Double

Dim x1 As Double
Dim x2 As Double
Dim D As Double

paramA = Val(txtParamA.Text)
paramB = Val(txtParamB.Text)
paramC = Val(txtParamC.Text)

If paramA = 0 Or paramB = 0 Or paramC = 0 Then
MsgBox "Нули в качестве коэффициентов не допускаются!", _
vbCritical
Exit Sub
End If

D = (paramB * paramB) - (4 * paramA * paramC)

If D > 0 Then
x1 = (paramB + Sqr(D)) / (2 * paramA)
x2 = (paramB - Sqr(D)) / (2 * paramA)
lblD.Caption = "Дискременант: " & D
lblX1.Caption = "Корень №1: " & x1
lblX2.Caption = "Корень №2: " & x2
ElseIf D = 0 Then
x1 = paramB / (2 * paramA)
x2 = x1
lblD.Caption = "Дискременант: " & D
lblX1.Caption = "Корень №1: " & x1
lblX2.Caption = "Корень №2 = Корню №1"
ElseIf D < 0 Then
lblD.Caption = "Дискременант: " & D
lblX1.Caption = "Корней нет!"
lblX2.Caption = ""
MsgBox "Дискременант меньше нуля! Корней нет!", vbCritical
End If
End Sub


Помогите, пожалуйста.
...
Рейтинг: 0 / 0
Построение параболы
    #33639876
Фотография Aklin
Скрыть профиль Поместить в игнор-лист Сообщения автора в теме
Участник
Мне б такую школу...
Я на экзамен писал под 3100 строк на VB.
Прим. По правилам форума код надо оформлять {SRC vba}{/SRC}
Код: plaintext
1.
2.
object.Line [Step] (x1, y1) [Step] - (x2, y2), [color], [F] - линия
Первую координату можно опускать, в этом случае она берется из последней координаты. 
object.Line [Step] - (x2, y2), [color], [B][F]
[b]object Optional.Object expression that evaluates to an object in the Applies To list. If object is omitted, the Form with thefocus is assumed to be object.
Step Optional.Keyword specifying that the starting point coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties.
(x1, y1) Optional. Single values indicating the coordinates of the starting point for the line or rectangle. The ScaleMode property determines the unit of measure used. If omitted, the line begins at the position indicated by CurrentX and CurrentY.
Step Optional. Keyword specifying that the end point coordinates are relative to the line starting point.
(x2, y2) Required. Single values indicating the coordinates of the end point for the line being drawn.
color Optional. Long integer value indicating the RGB color used to draw the line. If omitted, the ForeColor property setting is used. You can use the RGB function or QBColor function to specify the color.
B Optional. If included, causes a box to be drawn using the coordinates to specify opposite corners of the box.
F Optional. If the B option is used, the F option specifies that the box is filled with the same color used to draw the box. You cannot use F without B. If B is used without F, the box is filled with the current FillColor and FillStyle. The default value for FillStyle is transparent

Код: plaintext
1.
object.PSet [Step] (x, y), [color] - точка
object Optional.Object expression that evaluates to an object in the Applies To list. If object is omitted, the Form with thefocus is assumed to be object.
Step Optional.Keyword specifying that the coordinates are relative to the current graphics position given by the CurrentX and CurrentY properties.
(x, y) Required. Single values indicating the horizontal (x-axis) and vertical (y-axis) coordinates of the point to set.
color Optional. Long integer value indicating the RGB color specified for point. If omitted, the current ForeColor property setting is used. You can use the RGB function or QBColor function to specify the color.

Смотри также http://www.sql.ru/forum/actualtopics.aspx?search=%E3%F0%E0%F4%E8%EA&bid=22

По-умолчанию стоят твипы(см. свойства формы) надо переставить на миллиметры, пиксели или сантиметры
...
Рейтинг: 0 / 0
2 сообщений из 2, страница 1 из 1
Форумы / Visual Basic [игнор отключен] [закрыт для гостей] / Построение параболы
Найденые пользователи ...
Разблокировать пользователей ...
Читали форум (0):
Пользователи онлайн (0):
x
x
Закрыть


Просмотр
0 / 0
Close
Debug Console [Select Text]