Hi Leute,
weiß jemand wie man zwei Sinus Funftionen überlagern lassen kann?
Ich bin schon so: weit!
Option Explicit
Const Pi As Double = 3.14
Private Sub cmdLöschen_Click()
picAusgabe.Cls
End Sub
Private Sub cmdZeichnen_Click()
Dim n, X, Y
Dim Skal As Single, Dehn As Single, Genau As Single
cmdZeichnen.Enabled = False
Genau = txtGenauigkeit.Text
Skal = txtSkalierungsfaktor.Text
Dehn = txtDehnfaktor.Text
For n = 0 To 18 * Pi Step Genau
X = n * 6.28
If Option1 = True Then Y = Skal * Sin(n * Dehn) + 180
If Option2 = True Then Y = Skal * Cos(n * Dehn) + 180
If Option3 = True Then Y = Skal * -Sin(n * Dehn) + 180
If Option4 = True Then Y = Skal * -Cos(n * Dehn) + 180
picAusgabe.PSet (X, Y), vbRed
DoEvents
Next
picAusgabe.Line (0, 180)-(360, 180)
cmdZeichnen.Enabled = True
End Sub
Private Sub Form_Load()
txtSkalierungsfaktor.Text = 48
txtSkalierungsfaktor.Visible = False
txtDehnfaktor.Text = 0.75
txtGenauigkeit.Text = 0.001
picAusgabe.Scale (0, 360)-(360, 0)
End Sub
Private Sub Form_Unload(Cancel As Integer)
End
End Sub
Private Sub picAusgabe_MouseDown(Button As Integer, Shift As Integer, X As Single, Y As Single)
txtSkalierungsfaktor.Left = X
txtSkalierungsfaktor.Top = Y
txtSkalierungsfaktor.Visible = True
txtSkalierungsfaktor.SelLength = Len(txtSkalierungsfaktor.Text)
txtSkalierungsfaktor.SelStart = 0
txtSkalierungsfaktor.SetFocus
End Sub
Private Sub txtDrehnfaktor_KeyPress(KeyAscii As Integer)
End Sub
Private Sub txtSkalierungsfaktor_LostFocus()
txtSkalierungsfaktor.Visible = False
End Sub
Function EingabeOK(Zeichencode As Integer, Optional Textfeld As TextBox) As Boolean
EingabeOK = True
Select Case Chr(Zeichencode)
Case „0“ To „9“
Case „.“
If Not Textfeld Is Nothing Then
If InStr(Textfeld.Text, „.“) 0 Then EingabeOK = False
End If
Case Chr(vbKeyBack)
Case Else
EingabeOK = False
End Select
End Function
CU
Sven