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

Public radius As Double            ' Radius-Eigenschaft
'Public Index As Integer
Private Const Pi = 3.14159265358

Public Property Get durchmesser() As Double     ' Lesen der Durchmesser - Eigenschaft
  durchmesser = 2 * radius
End Property

Public Property Let durchmesser(durchmesser As Double)  ' Zuweisen der Durchmesser - Eigenschaft
 radius = durchmesser / 2
End Property

Public Property Get oberflaeche() As Double    ' Lesen der Oberflaeche - Eigenschaft
 oberflaeche = 4 * Pi * radius * radius
End Property

Public Property Let oberflaeche(oberflaeche As Double) ' Zuweisen der Oberflaeche - Eigenschaft
 radius = Sqr(oberflaeche / 4 / Pi)
End Property

Public Property Get volumen() As Double    ' Lesen der Volumen - Eigenschaft
 volumen = 4 / 3 * Pi * radius ^ 3
End Property

Public Property Let volumen(volumen As Double) ' Zuweisen der Volumen - Eigenschaft
 radius = (volumen * 3 / 4 / Pi) ^ (1 / 3)
End Property

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

