|
|
|
Построение параболы
|
|||
|---|---|---|---|
|
#18+
Привет! Я сейчас готовлю проект для экзамена. (школа). Короче говоря, квадратное уравнение. Я ввожу параметры а,б,с и мне выдает дискременант и корень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 Помогите, пожалуйста. ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2006, 20:00:58 |
|
||
|
Построение параболы
|
|||
|---|---|---|---|
|
#18+
Мне б такую школу... Я на экзамен писал под 3100 строк на VB. Прим. По правилам форума код надо оформлять {SRC vba}{/SRC} Код: plaintext 1. 2. 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. 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 По-умолчанию стоят твипы(см. свойства формы) надо переставить на миллиметры, пиксели или сантиметры ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 02.04.2006, 20:13:29 |
|
||
|
|

start [/forum/topic.php?fid=60&fpage=287&tid=2166123]: |
0ms |
get settings: |
8ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
29ms |
get topic data: |
11ms |
get forum data: |
3ms |
get page messages: |
34ms |
get tp. blocked users: |
2ms |
| others: | 235ms |
| total: | 344ms |

| 0 / 0 |
