VERSION 1.0 CLASS
BEGIN
  MultiUse = -1  'True
  Persistable = 0  'NotPersistable
  DataBindingBehavior = 0  'vbNone
  DataSourceBehavior  = 0  'vbNone
  MTSTransactionMode  = 0  'NotAnMTSObject
END
Attribute VB_Name = "clsKugel"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = False
' Objekt Kugel
Option Explicit
Dim m_r As Double
Dim m_d As Double
Dim m_O As Double
Dim m_V As Double
Private Const Pi = 3.14159265358

Public Property Get r() As Double     ' Lesen der Radius-Eigenschaft
  r = m_r
End Property

Public Property Let r(dNeur As Double)  ' Zuweisen der Radius-Eigenschaft
 m_r = dNeur
End Property

Public Property Get d() As Double     ' Lesen der Durchmesser - Eigenschaft
  d = m_d
End Property

Public Property Let d(dNeud As Double)  ' Zuweisen der Durchmesser - Eigenschaft
 m_d = dNeud
End Property

Public Property Get O() As Double    ' Lesen der Oberflaeche - Eigenschaft
 O = m_O
End Property

Public Property Let O(dNeuO As Double) ' Zuweisen der Oberflaeche - Eigenschaft
 m_O = dNeuO
End Property

Public Property Get V() As Double    ' Lesen der Volumen - Eigenschaft
 V = m_V
End Property

Public Property Let V(dNeuV As Double) ' Zuweisen der Volumen - Eigenschaft
 m_V = dNeuV
End Property

Public Sub zeichne(Pic As PictureBox)          ' Methoden - Definition
  Dim Faktor As Single
  Pic.Cls
  Pic.DrawStyle = 3
  Pic.Line (Pic.Width / 2 - r, Pic.Height / 2)-(Pic.Width / 2 + r, Pic.Height / 2), QBColor(9)
  Pic.Line (Pic.Width / 2, Pic.Height / 2 - r)-(Pic.Width / 2, Pic.Height / 2 + r), QBColor(9)
  Pic.DrawStyle = 0
  Pic.Circle (Pic.Width / 2, Pic.Height / 2), r, QBColor(12)
  For Faktor = 1 To 9 'Step 0.1
   Pic.Circle (Pic.Width / 2, Pic.Height / 2), r * Faktor / 10, , 1.9 * Pi, 1.1 * Pi / 2
  Next
End Sub

Public Sub rechne(index)
  If index = 0 Then        'Eingabe Radius
    m_d = 2 * r
    m_O = 4 * Pi * r ^ 2
    m_V = 4 / 3 * Pi * r ^ 3
    Form1.Text1(1) = Trim(Str(m_d))
    Form1.Text1(2) = Trim(Str(m_O))
    Form1.Text1(3) = Trim(Str(m_V))
  ElseIf index = 1 Then    'Eingabe Durchmesser
    m_r = d / 2
    m_O = 4 * Pi * r ^ 2
    m_V = 4 / 3 * Pi * r ^ 3
    Form1.Text1(0) = Trim(Str(m_r))
    Form1.Text1(2) = Trim(Str(m_O))
    Form1.Text1(3) = Trim(Str(m_V))
  ElseIf index = 2 Then    'Eingabe Oberfläche
    m_r = Sqr(O / 4 / Pi)
    m_d = 2 * r
    m_V = 4 / 3 * Pi * r ^ 3
    Form1.Text1(0) = Trim(Str(m_r))
    Form1.Text1(1) = Trim(Str(m_d))
    Form1.Text1(3) = Trim(Str(m_V))
  Else                     'Eingabe Volumen
    m_r = (V * 3 / 4 / Pi) ^ (1 / 3)
    m_d = 2 * r
    m_O = 4 * Pi * r ^ 2
    Form1.Text1(0) = Trim(Str(m_r))
    Form1.Text1(1) = Trim(Str(m_d))
    Form1.Text1(2) = Trim(Str(m_O))
  End If
End Sub
